Copy jTable row with its grid lines into excel/word documents(将 jTable 行及其网格线复制到 excel/word 文档中)
问题描述
是否可以复制 jTable 行并将其粘贴到 Word 文档或带有格式化网格(彩色水平和垂直网格线)的新电子邮件中.如果可以,如何?
Is it possible to copy jTable row and paste it into word document or in a new email with its formatted grid (colored horizontal and vertical grid lines).. If yes, how?
当我从 jTable 复制一行并将其粘贴到 Word 文档中时,Word 将其识别为表格行,但我必须通过添加网格线并为它们着色来设置样式
When I copy a row from jTable and paste it into word document, Word recognizes it as a table row but I have to style it by adding grid lines and coloring them
推荐答案
这是一个非常简单的示例,将一行数据复制到基于 HTML
的表中.我能够复制任何行并作为基于 HTML 的表格粘贴到 word 中,而没有(很多)问题
This is a VERY simply example of copying a row of data into a HTML
based table. I was able to copy any row and paste into word as a HTML based table without (to many) issues
这是非常有限的,因为这将简单地使用每个单元格的 toString
方法来获取单元格的值,这意味着单元格值不会根据值类型或应用程序格式化"要求.您将不得不自己设计一个解决方案,将单元格值格式化为 String
This is very limited, as this will simply use each cell's toString
method to get the value of the cell, this means that the cell value is not "formatted" according to the values type or application requirements. You're going to have to devise a solution for formatting the cell values to String
yourself
这篇关于将 jTable 行及其网格线复制到 excel/word 文档中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!