public class XWPFTable extends Object implements IBodyElement
Modifier and Type | Class and Description |
---|---|
static class |
XWPFTable.XWPFBorderType |
Modifier and Type | Field and Description |
---|---|
protected IBody |
part |
protected List<String> |
styleIDs |
protected List<XWPFTableRow> |
tableRows |
protected StringBuffer |
text |
Constructor and Description |
---|
XWPFTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table,
IBody part) |
XWPFTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table,
IBody part,
int row,
int col) |
Modifier and Type | Method and Description |
---|---|
void |
addNewCol()
add a new column for each row in this table
|
void |
addNewRowBetween(int start,
int end) |
void |
addRow(XWPFTableRow row)
add a new Row to the table
|
boolean |
addRow(XWPFTableRow row,
int pos)
add a new Row to the table
at position pos
|
XWPFTableRow |
createRow()
create a new XWPFTableRow object with as many cells as the number of columns defined in that moment
|
IBody |
getBody() |
int |
getCellMarginBottom() |
int |
getCellMarginLeft() |
int |
getCellMarginRight() |
int |
getCellMarginTop() |
int |
getColBandSize() |
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl |
getCTTbl() |
BodyElementType |
getElementType()
returns the type of the BodyElement Table
|
String |
getInsideHBorderColor() |
int |
getInsideHBorderSize() |
int |
getInsideHBorderSpace() |
XWPFTable.XWPFBorderType |
getInsideHBorderType() |
String |
getInsideVBorderColor() |
int |
getInsideVBorderSize() |
int |
getInsideVBorderSpace() |
XWPFTable.XWPFBorderType |
getInsideVBorderType() |
int |
getNumberOfRows() |
POIXMLDocumentPart |
getPart()
returns the part of the bodyElement
|
BodyType |
getPartType()
returns the partType of the bodyPart which owns the bodyElement
|
XWPFTableRow |
getRow(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow row)
returns the XWPFRow which belongs to the CTRow row
if this row is not existing in the table null will be returned
|
XWPFTableRow |
getRow(int pos) |
int |
getRowBandSize() |
List<XWPFTableRow> |
getRows() |
String |
getStyleID()
get the StyleID of the table
|
String |
getText() |
int |
getWidth() |
XWPFTableRow |
insertNewTableRow(int pos)
inserts a new tablerow
|
boolean |
removeRow(int pos)
Remove a row at position pos from the table
|
void |
setCellMargins(int top,
int left,
int bottom,
int right) |
void |
setColBandSize(int size) |
void |
setInsideHBorder(XWPFTable.XWPFBorderType type,
int size,
int space,
String rgbColor) |
void |
setInsideVBorder(XWPFTable.XWPFBorderType type,
int size,
int space,
String rgbColor) |
void |
setRowBandSize(int size) |
void |
setStyleID(String styleName)
Set the table style.
|
void |
setWidth(int width) |
protected StringBuffer text
protected List<XWPFTableRow> tableRows
protected IBody part
public XWPFTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table, IBody part, int row, int col)
public XWPFTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table, IBody part)
@Internal public org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl getCTTbl()
public String getText()
public void addNewRowBetween(int start, int end)
public void addNewCol()
public XWPFTableRow createRow()
public XWPFTableRow getRow(int pos)
pos
- - index of the rowpublic void setWidth(int width)
width
- public int getWidth()
public int getNumberOfRows()
public String getStyleID()
public void setStyleID(String styleName)
styleName
- - the style name to apply to this tablepublic XWPFTable.XWPFBorderType getInsideHBorderType()
public int getInsideHBorderSize()
public int getInsideHBorderSpace()
public String getInsideHBorderColor()
public XWPFTable.XWPFBorderType getInsideVBorderType()
public int getInsideVBorderSize()
public int getInsideVBorderSpace()
public String getInsideVBorderColor()
public int getRowBandSize()
public void setRowBandSize(int size)
public int getColBandSize()
public void setColBandSize(int size)
public void setInsideHBorder(XWPFTable.XWPFBorderType type, int size, int space, String rgbColor)
public void setInsideVBorder(XWPFTable.XWPFBorderType type, int size, int space, String rgbColor)
public int getCellMarginTop()
public int getCellMarginLeft()
public int getCellMarginBottom()
public int getCellMarginRight()
public void setCellMargins(int top, int left, int bottom, int right)
public void addRow(XWPFTableRow row)
row
- the row which should be addedpublic boolean addRow(XWPFTableRow row, int pos)
row
- the row which should be addedpublic XWPFTableRow insertNewTableRow(int pos)
pos
- public boolean removeRow(int pos) throws IndexOutOfBoundsException
pos
- position the Row in the TableIndexOutOfBoundsException
public List<XWPFTableRow> getRows()
public BodyElementType getElementType()
getElementType
in interface IBodyElement
IBodyElement.getElementType()
public IBody getBody()
getBody
in interface IBodyElement
public POIXMLDocumentPart getPart()
getPart
in interface IBodyElement
IBody.getPart()
public BodyType getPartType()
getPartType
in interface IBodyElement
IBody.getPartType()
public XWPFTableRow getRow(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow row)
Copyright © 2020. All rights reserved.