创建一个没有边框的表

时间:2016-06-16 17:18:24

标签: java openoffice.org openoffice-writer

我设法创建了一个表:

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

但是,这会创建具有默认边框的表格。我想在没有它的情况下创建这个表。

此属性由图像

设置

enter image description here

1 个答案:

答案 0 :(得分:1)

创建表,然后将边框宽度设置为0.这是来自https://www.mail-archive.com/dev@api.openoffice.org/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