public class XSLFTable extends XSLFGraphicFrame implements java.lang.Iterable<XSLFTableRow>, TableShape<XSLFShape,XSLFTextParagraph>
XSLFShape.ReparseFactory<T extends org.apache.xmlbeans.XmlObject>
Modifier and Type | Method and Description |
---|---|
void |
addColumn()
Add a new column at the end of the table.
(在表的末尾添加一个新列。)
|
XSLFTableRow |
addRow() |
XSLFTableCell |
getCell(int row, int col)
Gets a cell
(获取一个单元格)
|
double |
getColumnWidth(int idx)
Gets the width (in points) of the n-th column
(获取第 n 列的宽度(以磅为单位))
|
org.openxmlformats.schemas.drawingml.x2006.main.CTTable |
getCTTable() |
int |
getNumberOfColumns()
Return the maximum number of columns.
(返回最大列数。)
|
int |
getNumberOfRows()
Return the number of rows
(返回行数)
|
double |
getRowHeight(int row)
Gets the row height
(获取行高)
|
java.util.List<XSLFTableRow> |
getRows() |
protected XSLFTableStyle |
getTableStyle()
Get assigned TableStyle
(获取分配的 TableStyle)
|
void |
insertColumn(int colIdx)
Insert a new column at the given index.
(在给定索引处插入一个新列。)
|
XSLFTableRow |
insertRow(int rowIdx)
Insert a new row at the given index.
(在给定索引处插入新行。)
|
java.util.Iterator<XSLFTableRow> |
iterator() |
void |
mergeCells(int firstRow, int lastRow, int firstCol, int lastCol)
Merge cells of a table
(合并表格的单元格)
|
void |
removeColumn(int colIdx)
Remove the column at the given index.
(删除给定索引处的列。)
|
void |
removeRow(int rowIdx)
Remove the row on the given index
(删除给定索引上的行)
|
void |
setColumnWidth(int idx, double width)
Sets the width (in points) of the n-th column
(设置第 n 列的宽度(以磅为单位))
|
void |
setRowHeight(int row, double height)
Sets the row height.
(设置行高。)
|
void |
updateCellAnchor()
Calculates the bounding boxes of all cells and updates the dimension of the table
(计算所有单元格的边界框并更新表格的维度)
|
getAnchor, getChart, getFallbackPicture, getFlipHorizontal, getFlipVertical, getRotation, getShapeType, hasChart, setAnchor, setFlipHorizontal, setFlipVertical, setRotation
draw, fetchShapeProperty, getBgPr, getBgRef, getChild, getCNvPr, getFillPaint, getGrpSpPr, getParent, getPlaceholder, getPlaceholderDetails, getShapeId, getShapeName, getShapeProperties, getSheet, getSpStyle, getXmlObject, isPlaceholder, selectPaint, selectPaint, selectPaint, selectPaint, selectPaint, selectPaint, selectProperty, setParent, setPlaceholder
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
draw, getAnchor, getParent, getShapeId, getShapeName, getSheet
getAnchor, getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setAnchor, setFlipHorizontal, setFlipVertical, setRotation
public XSLFTableCell getCell(int row, int col)
TableShape
getCell
in interface
TableShape<XSLFShape,XSLFTextParagraph>
(接口 TableShape 中的 getCell
row
- the row index (0-based)
(row - 行索引(从 0 开始))
col
- the column index (0-based)
(col - 列索引(从 0 开始))
@Internal public org.openxmlformats.schemas.drawingml.x2006.main.CTTable getCTTable()
public int getNumberOfColumns()
TableShape
getNumberOfColumns
in interface
TableShape<XSLFShape,XSLFTextParagraph>
(接口 TableShape 中的 getNumberOfColumns
public int getNumberOfRows()
TableShape
getNumberOfRows
in interface
TableShape<XSLFShape,XSLFTextParagraph>
(接口 TableShape 中的 getNumberOfRows
public double getColumnWidth(int idx)
TableShape
getColumnWidth
in interface
TableShape<XSLFShape,XSLFTextParagraph>
(接口 TableShape 中的 getColumnWidth
idx
- the column index (0-based)
(idx - 列索引(从 0 开始))
public void setColumnWidth(int idx, double width)
TableShape
setColumnWidth
in interface
TableShape<XSLFShape,XSLFTextParagraph>
(接口 TableShape 中的 setColumnWidth
idx
- the column index (0-based)
(idx - 列索引(从 0 开始))
width
- the width (in points)
(width - 宽度(以磅为单位))
public double getRowHeight(int row)
TableShape
getRowHeight
in interface
TableShape<XSLFShape,XSLFTextParagraph>
(接口 TableShape 中的 getRowHeight
row
- the row index (0-based)
(row - 行索引(从 0 开始))
public void setRowHeight(int row, double height)
TableShape
setRowHeight
in interface
TableShape<XSLFShape,XSLFTextParagraph>
(接口 TableShape 中的 setRowHeight
row
- the row index (0-based)
(row - 行索引(从 0 开始))
height
- the height to set (in points)
(height - 要设置的高度(以磅为单位))
public java.util.Iterator<XSLFTableRow> iterator()
iterator
in interface
java.lang.Iterable<XSLFTableRow>
(接口 java.lang.Iterable 中的迭代器
public java.util.List<XSLFTableRow> getRows()
public XSLFTableRow addRow()
public XSLFTableRow insertRow(int rowIdx)
rowIdx
- the row index.
(rowIdx - 行索引。)
public void removeRow(int rowIdx)
rowIdx
- the row index
(rowIdx - 行索引)
public void addColumn()
public void insertColumn(int colIdx)
colIdx
- the column index.
(colIdx - 列索引。)
public void removeColumn(int colIdx)
colIdx
- the column index.
(colIdx - 列索引。)
public void mergeCells(int firstRow, int lastRow, int firstCol, int lastCol)
protected XSLFTableStyle getTableStyle()
public void updateCellAnchor()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.