简体   繁体   English

创建一个无边框的表

[英]Create a table without border

I've managed to create a table: 我设法创建了一个表:

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

However, this create the table with a default border. 但是,这将创建具有默认边框的表。 I would like to create this table without it. 我想创建没有它的表。

This property is setted by the image 此属性由图像设置

在此处输入图片说明

Create the table and then set the border width to 0. Here is a Python example from https://www.mail-archive.com/dev@api.openoffice.org/msg07317.html : 创建表,然后将边框宽度设置为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)

For a related Java example, search for "TableBorder" on this page: http://api.libreoffice.org/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java 对于相关的Java示例,请在此页面上搜索“ TableBorder”: http ://api.libreoffice.org/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.java

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM