我设法创建了一个表:

//I create the table here and the default name is table1
XTextTable xTT = (XTextTable) UnoRuntime.queryInterface(XTextTable.class, oInt);
xTT.initialize(1, 1);


但是,这将创建具有默认边框的表。我想创建没有它的表。

此属性由图像设置

java - 创建一个无边框的表-LMLPHP

最佳答案

创建表,然后将边框宽度设置为0。这是https://www.mail-archive.com/[email protected]/msg07317.html中的Python示例:

borderLine = BorderLine()
borderLine.OuterLineWidth = 0

tableBorder = table.getPropertyValue("TableBorder")
tableBorder.VerticalLine = borderLine
tableBorder.HorizontalLine = borderLine
tableBorder.LeftLine = borderLine
tableBorder.RightLine = borderLine
tableBorder.TopLine = borderLine
tableBorder.BottomLine = borderLine
table.setPropertyValue("TableBorder", tableBorder)


对于相关的Java示例,请在此页面上搜索“ TableBorder”:http://api.libreoffice.org/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java

07-24 16:00