Package org.apache.poi.xslf.usermodel
Class XSLFTable
- java.lang.Object
-
- org.apache.poi.xslf.usermodel.XSLFShape
-
- org.apache.poi.xslf.usermodel.XSLFGraphicFrame
-
- org.apache.poi.xslf.usermodel.XSLFTable
-
- All Implemented Interfaces:
java.lang.Iterable<XSLFTableRow>
,GraphicalFrame<XSLFShape,XSLFTextParagraph>
,PlaceableShape<XSLFShape,XSLFTextParagraph>
,Shape<XSLFShape,XSLFTextParagraph>
,TableShape<XSLFShape,XSLFTextParagraph>
public class XSLFTable extends XSLFGraphicFrame implements java.lang.Iterable<XSLFTableRow>, TableShape<XSLFShape,XSLFTextParagraph>
Represents a table in a .pptx presentation
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XSLFTableRow
addRow()
XSLFTableCell
getCell(int row, int col)
Gets a celldouble
getColumnWidth(int idx)
Gets the width (in points) of the n-th columnorg.openxmlformats.schemas.drawingml.x2006.main.CTTable
getCTTable()
int
getNumberOfColumns()
Return the maximum number of columns.int
getNumberOfRows()
Return the number of rowsdouble
getRowHeight(int row)
Gets the row heightjava.util.List<XSLFTableRow>
getRows()
protected XSLFTableStyle
getTableStyle()
Get assigned TableStylejava.util.Iterator<XSLFTableRow>
iterator()
void
mergeCells(int firstRow, int lastRow, int firstCol, int lastCol)
Merge cells of a tablevoid
setColumnWidth(int idx, double width)
Sets the width (in points) of the n-th columnvoid
setRowHeight(int row, double height)
Sets the row height.-
Methods inherited from class org.apache.poi.xslf.usermodel.XSLFGraphicFrame
getAnchor, getFallbackPicture, getFlipHorizontal, getFlipVertical, getRotation, getShapeType, setAnchor, setFlipHorizontal, setFlipVertical, setRotation
-
Methods inherited from class org.apache.poi.xslf.usermodel.XSLFShape
draw, fetchShapeProperty, getBgPr, getBgRef, getChild, getCNvPr, getFillPaint, getGrpSpPr, getParent, getPlaceholder, getPlaceholderDetails, getShapeId, getShapeName, getShapeProperties, getSheet, getSpStyle, getXmlObject, isPlaceholder, selectPaint, selectPaint, selectPaint, selectPaint, selectPaint, selectProperty, setParent, setPlaceholder
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.poi.sl.usermodel.PlaceableShape
getAnchor, getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setAnchor, setFlipHorizontal, setFlipVertical, setRotation
-
Methods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getAnchor, getParent, getShapeId, getShapeName, getSheet
-
-
-
-
Method Detail
-
getCell
public XSLFTableCell getCell(int row, int col)
Description copied from interface:TableShape
Gets a cell- Specified by:
getCell
in interfaceTableShape<XSLFShape,XSLFTextParagraph>
- Parameters:
row
- the row index (0-based)col
- the column index (0-based)- Returns:
- the cell or null if the cell doesn't exists, e.g. when accessing a merged cell or if the index is out of bounds
-
getCTTable
@Internal public org.openxmlformats.schemas.drawingml.x2006.main.CTTable getCTTable()
-
getNumberOfColumns
public int getNumberOfColumns()
Description copied from interface:TableShape
Return the maximum number of columns. If the table contains merged cells, the number of columns might be less than the maximum.- Specified by:
getNumberOfColumns
in interfaceTableShape<XSLFShape,XSLFTextParagraph>
- Returns:
- the maximum number of column
-
getNumberOfRows
public int getNumberOfRows()
Description copied from interface:TableShape
Return the number of rows- Specified by:
getNumberOfRows
in interfaceTableShape<XSLFShape,XSLFTextParagraph>
- Returns:
- the row count
-
getColumnWidth
public double getColumnWidth(int idx)
Description copied from interface:TableShape
Gets the width (in points) of the n-th column- Specified by:
getColumnWidth
in interfaceTableShape<XSLFShape,XSLFTextParagraph>
- Parameters:
idx
- the column index (0-based)- Returns:
- the width (in points)
-
setColumnWidth
public void setColumnWidth(int idx, double width)
Description copied from interface:TableShape
Sets the width (in points) of the n-th column- Specified by:
setColumnWidth
in interfaceTableShape<XSLFShape,XSLFTextParagraph>
- Parameters:
idx
- the column index (0-based)width
- the width (in points)
-
getRowHeight
public double getRowHeight(int row)
Description copied from interface:TableShape
Gets the row height- Specified by:
getRowHeight
in interfaceTableShape<XSLFShape,XSLFTextParagraph>
- Parameters:
row
- the row index (0-based)- Returns:
- the height (in points)
-
setRowHeight
public void setRowHeight(int row, double height)
Description copied from interface:TableShape
Sets the row height.- Specified by:
setRowHeight
in interfaceTableShape<XSLFShape,XSLFTextParagraph>
- Parameters:
row
- the row index (0-based)height
- the height to set (in points)
-
iterator
public java.util.Iterator<XSLFTableRow> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<XSLFTableRow>
-
getRows
public java.util.List<XSLFTableRow> getRows()
-
addRow
public XSLFTableRow addRow()
-
mergeCells
public void mergeCells(int firstRow, int lastRow, int firstCol, int lastCol)
Merge cells of a table
-
getTableStyle
protected XSLFTableStyle getTableStyle()
Get assigned TableStyle- Returns:
- the assigned TableStyle
- Since:
- POI 3.15-beta2
-
-