XSLFTable 所有的方法和属性
时间: 2024-05-27 15:13:47 浏览: 119
XSLFTable 是 Apache POI 中操作 PowerPoint 表格的类,它的所有方法和属性如下:
属性:
- int getNumberOfColumns():获取表格的列数。
- int getNumberOfRows():获取表格的行数。
- XSLFTableRow getRow(int rowIndex):获取表格中指定行索引的行。
- XSLFTableRow addRow():向表格中添加一行。
- XSLFTableRow addRow(int rowIndex):在指定行索引处向表格中添加一行。
- XSLFTableRow removeRow(int rowIndex):从表格中删除指定行索引的行。
- XSLFTableCell getCell(int rowIndex, int columnIndex):获取指定行索引和列索引的单元格。
- XSLFTableCell mergeCells(int firstRow, int lastRow, int firstCol, int lastCol):合并指定区域的单元格。
- XSLFTableCell splitCell(int rowIndex, int columnIndex, int rowspan, int colspan):拆分单元格并返回新的单元格。
方法:
- void setColumnWidth(int columnIndex, double width):设置指定列的宽度。
- void setAllColumnWidth(double width):设置所有列的宽度。
- void setHeight(double height):设置表格的高度。
- void setAnchor(Rectangle2D anchor):设置表格的位置和大小。
- void setBorderColor(Color color):设置表格的边框颜色。
- void setBorderWidth(double width):设置表格的边框宽度。
- void setColumnFill(int columnIndex, Fill fill):设置指定列的填充方式。
- void setAllColumnFill(Fill fill):设置所有列的填充方式。
- void setStyle(XSLFTableStyle tableStyle):设置表格的样式。
- void setHeaderRowCount(int count):设置表格的标题行数。
- void setInsideBorder(XSLFTableBorderType borderType, Color color, double borderWidth):设置表格内部边框。
- void setOutsideBorder(XSLFTableBorderType borderType, Color color, double borderWidth):设置表格外部边框。
- void setRowBandSize(int size):设置表格行的带状大小。
- void setColumnBandSize(int size):设置表格列的带状大小。
以上就是 XSLFTable 类的所有方法和属性。