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
|
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
|
void |
insertColumn(int colIdx)
Insert a new column 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
|
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, selectProperty, 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>
row
- the row index (0-based)col
- the column index (0-based)@Internal public org.openxmlformats.schemas.drawingml.x2006.main.CTTable getCTTable()
public int getNumberOfColumns()
TableShape
getNumberOfColumns
in interface TableShape<XSLFShape,XSLFTextParagraph>
public int getNumberOfRows()
TableShape
getNumberOfRows
in interface TableShape<XSLFShape,XSLFTextParagraph>
public double getColumnWidth(int idx)
TableShape
getColumnWidth
in interface TableShape<XSLFShape,XSLFTextParagraph>
idx
- the column index (0-based)public void setColumnWidth(int idx, double width)
TableShape
setColumnWidth
in interface TableShape<XSLFShape,XSLFTextParagraph>
idx
- the column index (0-based)width
- the width (in points)public double getRowHeight(int row)
TableShape
getRowHeight
in interface TableShape<XSLFShape,XSLFTextParagraph>
row
- the row index (0-based)public void setRowHeight(int row, double height)
TableShape
setRowHeight
in interface TableShape<XSLFShape,XSLFTextParagraph>
row
- the row index (0-based)height
- the height to set (in points)public java.util.Iterator<XSLFTableRow> iterator()
iterator
in interface java.lang.Iterable<XSLFTableRow>
public java.util.List<XSLFTableRow> getRows()
public XSLFTableRow addRow()
public void removeRow(int rowIdx)
rowIdx
- the row indexpublic void addColumn()
public void insertColumn(int colIdx)
colIdx
- the column index.public void removeColumn(int colIdx)
colIdx
- the column index.public void mergeCells(int firstRow, int lastRow, int firstCol, int lastCol)
protected XSLFTableStyle getTableStyle()
public void updateCellAnchor()
Copyright 2020 The Apache Software Foundation or its licensors, as applicable.