public class XWPFTable extends java.lang.Object implements IBodyElement, ISDTContents
Sketch of XWPFTable class. Only table's text is being hold.
Specifies the contents of a table present in the document. A table is a set of paragraphs (and other block-level content) arranged in rows and columns.
(XWPFTable 类的草图。只有表格的文本被保留。指定文档中存在的表格的内容。表格是一组按行和列排列的段落(和其他块级内容)。)Modifier and Type | Class and Description |
---|---|
static class |
XWPFTable.XWPFBorderType |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_PERCENTAGE_WIDTH |
protected IBody |
part |
static java.lang.String |
REGEX_PERCENTAGE |
static java.lang.String |
REGEX_WIDTH_VALUE |
protected java.util.List<XWPFTableRow> |
tableRows |
protected java.lang.StringBuilder |
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 cell at the end of each row in this table, creating a new column.
(在此表中每一行的末尾添加一个新单元格,创建一个新列。)
|
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
(在位置 pos 的表中添加一个新行)
|
XWPFTableRow |
createRow()
create a new XWPFTableRow object with as many cells as the number of columns defined in that moment
(创建一个新的 XWPFTableRow 对象,其单元格与当时定义的列数一样多)
|
IBody |
getBody() |
java.lang.String |
getBottomBorderColor()
Get bottom border color
(获取底部边框颜色)
|
int |
getBottomBorderSize()
Get bottom border size
(获取底部边框大小)
|
int |
getBottomBorderSpace()
Get bottom border spacing
(获取底部边框间距)
|
XWPFTable.XWPFBorderType |
getBottomBorderType()
Get bottom border type
(获取底部边框类型)
|
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
(返回 BodyElement 表的类型)
|
java.lang.String |
getInsideHBorderColor()
Get inside horizontal border color
(进入水平边框颜色)
|
int |
getInsideHBorderSize()
Get inside horizontal border size
(进入水平边框大小)
|
int |
getInsideHBorderSpace()
Get inside horizontal border spacing
(进入水平边框间距)
|
XWPFTable.XWPFBorderType |
getInsideHBorderType()
Get inside horizontal border type
(进入水平边框类型)
|
java.lang.String |
getInsideVBorderColor()
Get inside vertical border color
(获取内部垂直边框颜色)
|
int |
getInsideVBorderSize()
Get inside vertical border size
(获取内部垂直边框大小)
|
int |
getInsideVBorderSpace()
Get inside vertical border spacing
(获取内部垂直边框间距)
|
XWPFTable.XWPFBorderType |
getInsideVBorderType()
Get inside vertical border type
(进入垂直边框类型)
|
java.lang.String |
getLeftBorderColor()
Get Left border color
(获取左边框颜色)
|
int |
getLeftBorderSize()
Get Left border size
(获取左边框大小)
|
int |
getLeftBorderSpace()
Get Left border spacing
(获取左边框间距)
|
XWPFTable.XWPFBorderType |
getLeftBorderType()
Get Left border type
(获取左边框类型)
|
int |
getNumberOfRows() |
POIXMLDocumentPart |
getPart()
returns the part of the bodyElement
(返回 bodyElement 的部分)
|
BodyType |
getPartType()
returns the partType of the bodyPart which owns the bodyElement
(返回拥有 bodyElement 的 bodyPart 的 partType)
|
java.lang.String |
getRightBorderColor()
Get Right border color
(获取右边框颜色)
|
int |
getRightBorderSize()
Get Right border size
(获取右边框大小)
|
int |
getRightBorderSpace()
Get Right border spacing
(获取右边框间距)
|
XWPFTable.XWPFBorderType |
getRightBorderType()
Get Right border type
(获取右边框类型)
|
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
(如果表中不存在该行,则返回属于 CTRow 行的 XWPFRow 将返回 null)
|
XWPFTableRow |
getRow(int pos) |
int |
getRowBandSize() |
java.util.List<XWPFTableRow> |
getRows() |
java.lang.String |
getStyleID()
get the StyleID of the table
(获取表格的 StyleID)
|
TableRowAlign |
getTableAlignment()
Returns the current table alignment or NULL
(返回当前表格对齐方式或 NULL)
|
java.lang.String |
getText()
Convenience method to extract text in cells.
(在单元格中提取文本的便捷方法。)
|
java.lang.String |
getTopBorderColor()
Get top border color
(获取顶部边框颜色)
|
int |
getTopBorderSize()
Get top border size
(获取顶部边框大小)
|
int |
getTopBorderSpace()
Get top border spacing
(获取顶部边框间距)
|
XWPFTable.XWPFBorderType |
getTopBorderType()
Get top border type
(获取顶部边框类型)
|
int |
getWidth()
Get the width value as an integer.
(以整数形式获取宽度值。)
|
double |
getWidthDecimal()
Get the table width as a decimal value.
(以十进制值获取表格宽度。)
|
protected static double |
getWidthDecimal(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth ctWidth)
Get the width as a decimal value.
(获取宽度为十进制值。)
|
TableWidthType |
getWidthType()
Get the width type for the table, as an
STTblWidth.Enum value.
(获取表格的宽度类型,作为 STTblWidth.Enum 值。)
|
protected static TableWidthType |
getWidthType(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth ctWidth)
Get the width type from the width value
(从宽度值获取宽度类型)
|
XWPFTableRow |
insertNewTableRow(int pos)
inserts a new tablerow
(插入一个新的表格行)
|
void |
removeBorders()
Remove all borders from table
(从表格中删除所有边框)
|
void |
removeBottomBorder()
Remove bottom borders for table
(删除表格的底部边框)
|
void |
removeInsideHBorder()
Remove inside horizontal borders for table
(删除表格的内部水平边框)
|
void |
removeInsideVBorder()
Remove inside vertical borders for table
(删除表格的内部垂直边框)
|
void |
removeLeftBorder()
Remove left borders for table
(删除表格的左边框)
|
void |
removeRightBorder()
Remove right borders for table
(删除表格的右边框)
|
boolean |
removeRow(int pos)
Remove a row at position pos from the table
(从表中删除位置 pos 处的一行)
|
void |
removeTableAlignment()
Removes the table alignment attribute from a table
(从表格中删除表格对齐属性)
|
void |
removeTopBorder()
Remove top borders for table
(删除表格的顶部边框)
|
void |
setBottomBorder(XWPFTable.XWPFBorderType type, int size, int space, java.lang.String rgbColor)
Set Bottom borders for table
(设置表格的底部边框)
|
void |
setCellMargins(int top, int left, int bottom, int right) |
void |
setColBandSize(int size) |
void |
setInsideHBorder(XWPFTable.XWPFBorderType type, int size, int space, java.lang.String rgbColor)
Set Inside horizontal borders for a table
(设置表格的内部水平边框)
|
void |
setInsideVBorder(XWPFTable.XWPFBorderType type, int size, int space, java.lang.String rgbColor)
Set Inside Vertical borders for table
(为表格设置内部垂直边框)
|
void |
setLeftBorder(XWPFTable.XWPFBorderType type, int size, int space, java.lang.String rgbColor)
Set Left borders for table
(设置表格的左边框)
|
void |
setRightBorder(XWPFTable.XWPFBorderType type, int size, int space, java.lang.String rgbColor)
Set Right borders for table
(为表格设置右边框)
|
void |
setRowBandSize(int size) |
void |
setStyleID(java.lang.String styleName)
Set the table style.
(设置表格样式。)
|
void |
setTableAlignment(TableRowAlign tra)
Set table alignment to specified
TableRowAlign
(将表格对齐设置为指定的 TableRowAlign)
|
void |
setTopBorder(XWPFTable.XWPFBorderType type, int size, int space, java.lang.String rgbColor)
Set Top borders for table
(设置表格的顶部边框)
|
void |
setWidth(int width)
Set the width in 20ths of a point (twips).
(以点的 20 分之一(缇)为单位设置宽度。)
|
void |
setWidth(java.lang.String widthValue)
Set the width to the value "auto", an integer value (20ths of a point), or a percentage ("nn.nn%").
(将宽度设置为值“auto”、整数值(点的 20 分之一)或百分比(“nn.nn%”)。)
|
protected static void |
setWidthPercentage(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth ctWidth, java.lang.String widthValue)
Set the underlying table width value to a percentage value.
(将基础表宽度值设置为百分比值。)
|
void |
setWidthType(TableWidthType widthType)
Set the width value type for the table.
(设置表格的宽度值类型。)
|
protected static void |
setWidthType(TableWidthType widthType, org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth ctWidth)
Set the width type if different from current width type
(如果与当前宽度类型不同,则设置宽度类型)
|
protected static void |
setWidthValue(java.lang.String widthValue, org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth ctWidth)
Set the width value from a string
(从字符串设置宽度值)
|
public static final java.lang.String REGEX_PERCENTAGE
public static final java.lang.String DEFAULT_PERCENTAGE_WIDTH
public static final java.lang.String REGEX_WIDTH_VALUE
protected java.lang.StringBuilder text
protected final java.util.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 java.lang.String getText()
To get all text within a table, see XWPFWordExtractor's appendTableText as an example.
(在单元格中提取文本的便捷方法。这不会在单元格中递归提取文本,并且当前不包括 SDT(表单)组件中的文本。要获取表格中的所有文本,请参阅 XWPFWordExtractor 的 appendTableText 作为示例。)public void addNewCol()
public XWPFTableRow createRow()
public XWPFTableRow getRow(int pos)
pos
- - index of the row
(pos - - 行的索引)
public int getWidth()
If the width type is AUTO, DXA, or NIL, the value is 20ths of a point. If the width type is PCT, the value is the percentage times 50 (e.g., 2500 for 50%).
(以整数形式获取宽度值。如果宽度类型为 AUTO、DXA 或 NIL,则值为 20ths of a point。如果宽度类型为 PCT,则该值为百分比乘以 50(例如,2500 表示 50%)。)public void setWidth(int width)
width
- Width value (20ths of a point)
(width - 宽度值(点的 20 分之一))
public int getNumberOfRows()
public TableRowAlign getTableAlignment()
TableRowAlign
enum
(表对齐作为 TableRowAlign 枚举)
public void setTableAlignment(TableRowAlign tra)
TableRowAlign
(将表格对齐设置为指定的 TableRowAlign)
tra
-
TableRowAlign
to set
(tra - 要设置的 TableRowAlign)
public void removeTableAlignment()
public java.lang.String getStyleID()
public void setStyleID(java.lang.String styleName)
styleName
- - the style name to apply to this table
(styleName - - 应用于此表的样式名称)
public XWPFTable.XWPFBorderType getInsideHBorderType()
XWPFTable.XWPFBorderType
of the inside horizontal borders or null if missing
(内部水平边框的 XWPFTable.XWPFBorderType 或 null 如果缺少)
public int getInsideHBorderSize()
public int getInsideHBorderSpace()
public java.lang.String getInsideHBorderColor()
public XWPFTable.XWPFBorderType getInsideVBorderType()
XWPFTable.XWPFBorderType
of the inside vertical borders or null if missing
(内部垂直边框的 XWPFTable.XWPFBorderType 或 null 如果缺少)
public int getInsideVBorderSize()
public int getInsideVBorderSpace()
public java.lang.String getInsideVBorderColor()
public XWPFTable.XWPFBorderType getTopBorderType()
XWPFTable.XWPFBorderType
of the top borders or null if missing
(顶部边框的 XWPFTable.XWPFBorderType 或 null 如果缺少)
public int getTopBorderSize()
public int getTopBorderSpace()
public java.lang.String getTopBorderColor()
public XWPFTable.XWPFBorderType getBottomBorderType()
XWPFTable.XWPFBorderType
of the bottom borders or null if missing
(底部边框的 XWPFTable.XWPFBorderType 或 null 如果缺少)
public int getBottomBorderSize()
public int getBottomBorderSpace()
public java.lang.String getBottomBorderColor()
public XWPFTable.XWPFBorderType getLeftBorderType()
XWPFTable.XWPFBorderType
of the Left borders or null if missing
(左边框的 XWPFTable.XWPFBorderType 或 null 如果缺少)
public int getLeftBorderSize()
public int getLeftBorderSpace()
public java.lang.String getLeftBorderColor()
public XWPFTable.XWPFBorderType getRightBorderType()
XWPFTable.XWPFBorderType
of the Right borders or null if missing
(右边框的 XWPFTable.XWPFBorderType 或 null 如果缺少)
public int getRightBorderSize()
public int getRightBorderSpace()
public java.lang.String getRightBorderColor()
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, java.lang.String rgbColor)
type
- -
XWPFTable.XWPFBorderType
e.g. single, double, thick
(type - - XWPFTable.XWPFBorderType 例如single、double、thick)
size
- - Specifies the width of the current border. The width of this border is specified in measurements of eighths of a point, with a minimum value of two (onefourth of a point) and a maximum value of 96 (twelve points). Any values outside this range may be reassigned to a more appropriate value.
(size - - 指定当前边框的宽度。此边界的宽度以八分之一点的测量值指定,最小值为 2(点的四分之一),最大值为 96(十二点)。此范围之外的任何值都可以重新分配给更合适的值。)
space
- - Specifies the spacing offset that shall be used to place this border on the table
(space - - 指定用于在表格上放置此边框的间距偏移量)
rgbColor
- - This color may either be presented as a hex value (in RRGGBB format), or auto to allow a consumer to automatically determine the border color as appropriate.
(rgbColor - - 此颜色可以显示为十六进制值(RRGGBB 格式),或 auto 以允许消费者根据需要自动确定边框颜色。)
public void setInsideVBorder(XWPFTable.XWPFBorderType type, int size, int space, java.lang.String rgbColor)
type
- -
XWPFTable.XWPFBorderType
e.g. single, double, thick
(type - - XWPFTable.XWPFBorderType 例如single、double、thick)
size
- - Specifies the width of the current border. The width of this border is specified in measurements of eighths of a point, with a minimum value of two (onefourth of a point) and a maximum value of 96 (twelve points). Any values outside this range may be reassigned to a more appropriate value.
(size - - 指定当前边框的宽度。此边界的宽度以八分之一点的测量值指定,最小值为 2(点的四分之一),最大值为 96(十二点)。此范围之外的任何值都可以重新分配给更合适的值。)
space
- - Specifies the spacing offset that shall be used to place this border on the table
(space - - 指定用于在表格上放置此边框的间距偏移量)
rgbColor
- - This color may either be presented as a hex value (in RRGGBB format), or auto to allow a consumer to automatically determine the border color as appropriate.
(rgbColor - - 此颜色可以显示为十六进制值(RRGGBB 格式),或 auto 以允许消费者根据需要自动确定边框颜色。)
public void setTopBorder(XWPFTable.XWPFBorderType type, int size, int space, java.lang.String rgbColor)
type
- -
XWPFTable.XWPFBorderType
e.g. single, double, thick
(type - - XWPFTable.XWPFBorderType 例如single、double、thick)
size
- - Specifies the width of the current border. The width of this border is specified in measurements of eighths of a point, with a minimum value of two (onefourth of a point) and a maximum value of 96 (twelve points). Any values outside this range may be reassigned to a more appropriate value.
(size - - 指定当前边框的宽度。此边界的宽度以八分之一点的测量值指定,最小值为 2(点的四分之一),最大值为 96(十二点)。此范围之外的任何值都可以重新分配给更合适的值。)
space
- - Specifies the spacing offset that shall be used to place this border on the table
(space - - 指定用于在表格上放置此边框的间距偏移量)
rgbColor
- - This color may either be presented as a hex value (in RRGGBB format), or auto to allow a consumer to automatically determine the border color as appropriate.
(rgbColor - - 此颜色可以显示为十六进制值(RRGGBB 格式),或 auto 以允许消费者根据需要自动确定边框颜色。)
public void setBottomBorder(XWPFTable.XWPFBorderType type, int size, int space, java.lang.String rgbColor)
type
- -
XWPFTable.XWPFBorderType
e.g. single, double, thick
(type - - XWPFTable.XWPFBorderType 例如single、double、thick)
size
- - Specifies the width of the current border. The width of this border is specified in measurements of eighths of a point, with a minimum value of two (onefourth of a point) and a maximum value of 96 (twelve points). Any values outside this range may be reassigned to a more appropriate value.
(size - - 指定当前边框的宽度。此边界的宽度以八分之一点的测量值指定,最小值为 2(点的四分之一),最大值为 96(十二点)。此范围之外的任何值都可以重新分配给更合适的值。)
space
- - Specifies the spacing offset that shall be used to place this border on the table
(space - - 指定用于在表格上放置此边框的间距偏移量)
rgbColor
- - This color may either be presented as a hex value (in RRGGBB format), or auto to allow a consumer to automatically determine the border color as appropriate.
(rgbColor - - 此颜色可以显示为十六进制值(RRGGBB 格式),或 auto 以允许消费者根据需要自动确定边框颜色。)
public void setLeftBorder(XWPFTable.XWPFBorderType type, int size, int space, java.lang.String rgbColor)
type
- -
XWPFTable.XWPFBorderType
e.g. single, double, thick
(type - - XWPFTable.XWPFBorderType 例如single、double、thick)
size
- - Specifies the width of the current border. The width of this border is specified in measurements of eighths of a point, with a minimum value of two (onefourth of a point) and a maximum value of 96 (twelve points). Any values outside this range may be reassigned to a more appropriate value.
(size - - 指定当前边框的宽度。此边界的宽度以八分之一点的测量值指定,最小值为 2(点的四分之一),最大值为 96(十二点)。此范围之外的任何值都可以重新分配给更合适的值。)
space
- - Specifies the spacing offset that shall be used to place this border on the table
(space - - 指定用于在表格上放置此边框的间距偏移量)
rgbColor
- - This color may either be presented as a hex value (in RRGGBB format), or auto to allow a consumer to automatically determine the border color as appropriate.
(rgbColor - - 此颜色可以显示为十六进制值(RRGGBB 格式),或 auto 以允许消费者根据需要自动确定边框颜色。)
public void setRightBorder(XWPFTable.XWPFBorderType type, int size, int space, java.lang.String rgbColor)
type
- -
XWPFTable.XWPFBorderType
e.g. single, double, thick
(type - - XWPFTable.XWPFBorderType 例如single、double、thick)
size
- - Specifies the width of the current border. The width of this border is specified in measurements of eighths of a point, with a minimum value of two (onefourth of a point) and a maximum value of 96 (twelve points). Any values outside this range may be reassigned to a more appropriate value.
(size - - 指定当前边框的宽度。此边界的宽度以八分之一点的测量值指定,最小值为 2(点的四分之一),最大值为 96(十二点)。此范围之外的任何值都可以重新分配给更合适的值。)
space
- - Specifies the spacing offset that shall be used to place this border on the table
(space - - 指定用于在表格上放置此边框的间距偏移量)
rgbColor
- - This color may either be presented as a hex value (in RRGGBB format), or auto to allow a consumer to automatically determine the border color as appropriate.
(rgbColor - - 此颜色可以显示为十六进制值(RRGGBB 格式),或 auto 以允许消费者根据需要自动确定边框颜色。)
public void removeInsideHBorder()
public void removeInsideVBorder()
public void removeTopBorder()
public void removeBottomBorder()
public void removeLeftBorder()
public void removeRightBorder()
public void removeBorders()
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 added
(row - 应该添加的行)
public boolean addRow(XWPFTableRow row, int pos)
row
- the row which should be added
(row - 应该添加的行)
public XWPFTableRow insertNewTableRow(int pos)
pos
-
(邮政 -)
public boolean removeRow(int pos) throws java.lang.IndexOutOfBoundsException
pos
- position the Row in the Table
(pos - 在表格中定位行)
java.lang.IndexOutOfBoundsException
(java.lang.IndexOutOfBoundsException)
public java.util.List<XWPFTableRow> getRows()
public BodyElementType getElementType()
getElementType
in interface
IBodyElement
(接口 IBodyElement 中的 getElementType)
IBodyElement.getElementType()
public IBody getBody()
getBody
in interface
IBodyElement
(接口 IBodyElement 中的 getBody)
public POIXMLDocumentPart getPart()
getPart
in interface
IBodyElement
(接口 IBodyElement 中的 getPart)
IBody.getPart()
public BodyType getPartType()
getPartType
in interface
IBodyElement
(接口 IBodyElement 中的 getPartType)
IBody.getPartType()
public XWPFTableRow getRow(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow row)
public double getWidthDecimal()
If the width type is DXA or AUTO, then the value will always have a fractional part of zero (because these values are really integers). If the with type is percentage, then value may have a non-zero fractional part.
(以十进制值获取表格宽度。如果宽度类型是 DXA 或 AUTO,则该值将始终具有零的小数部分(因为这些值实际上是整数)。如果 with 类型是百分比,那么 value 可能有一个非零的小数部分。)protected static double getWidthDecimal(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth ctWidth)
This method is also used by table cells.
(获取宽度为十进制值。表格单元格也使用此方法。)ctWidth
- Width value to evaluate.
(ctWidth - 要评估的宽度值。)
public TableWidthType getWidthType()
STTblWidth.Enum
value. A table width can be specified as an absolute measurement (an integer number of twips), a percentage, or the value "AUTO".
(获取表格的宽度类型,作为 STTblWidth.Enum 值。表格宽度可以指定为绝对测量值(缇的整数)、百分比或值“AUTO”。)
protected static TableWidthType getWidthType(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth ctWidth)
ctWidth
- CTTblWidth to evalute
(ctWidth - 要评估的 CTTblWidth)
public void setWidth(java.lang.String widthValue)
widthValue
- String matching one of "auto", [0-9]+, or [0-9]+(\.[0-9]+)%.
(widthValue - 匹配“auto”、[0-9]+ 或 [0-9]+(.[0-9]+)% 之一的字符串。)
protected static void setWidthValue(java.lang.String widthValue, org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth ctWidth)
widthValue
- The width value string
(widthValue - 宽度值字符串)
ctWidth
- CTTblWidth to set the value on.
(ctWidth - 设置值的 CTTblWidth。)
protected static void setWidthPercentage(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth ctWidth, java.lang.String widthValue)
ctWidth
- The CTTblWidth to set the value on
(ctWidth - 设置值的 CTTblWidth)
widthValue
- String width value in form "33.3%" or an integer that is 50 times desired percentage value (e.g, 2500 for 50%)
(widthValue - 格式为“33.3%”的字符串宽度值或 50 倍所需百分比值的整数(例如,2500 表示 50%))
public void setWidthType(TableWidthType widthType)
If the width type is changed from the current type and the currently-set value is not consistent with the new width type, the value is reset to the default value for the specified width type.
(设置表格的宽度值类型。如果宽度类型从当前类型改变,并且当前设置的值与新的宽度类型不一致,则将该值重置为指定宽度类型的默认值。)widthType
- Width type
(widthType - 宽度类型)
protected static void setWidthType(TableWidthType widthType, org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth ctWidth)
widthType
- The new width type
(widthType - 新的宽度类型)
ctWidth
- CTTblWidth to set the type on
(ctWidth - 设置类型的 CTTblWidth)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.