public class CellFormat
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
clearFormatting()
Resets to default cell formatting.
|
java.lang.Object |
fetchInheritedBorderAttr(int key) |
java.lang.Object |
fetchInheritedShadingAttr(int key) |
BorderCollection |
getBorders()
Gets collection of borders of the cell.
|
double |
getBottomPadding()
Gets the amount of space (in points) to add below the contents of cell.
|
java.lang.Object |
getDirectBorderAttr(int key) |
boolean |
getFitText()
If true, fits text in the cell, compressing each paragraph to the width of the cell.
|
int |
getHorizontalMerge()
Specifies how the cell is merged horizontally with other cells in the row.
|
double |
getLeftPadding()
Gets the amount of space (in points) to add to the left of the contents of cell.
|
int |
getOrientation()
Gets the orientation of text in a table cell.
|
PreferredWidth |
getPreferredWidth()
Gets the preferred width of the cell.
|
double |
getRightPadding()
Gets the amount of space (in points) to add to the right of the contents of cell.
|
Shading |
getShading()
Returns a Shading object that refers to the shading formatting for the cell.
|
double |
getTopPadding()
Gets the amount of space (in points) to add above the contents of cell.
|
int |
getVerticalAlignment()
Gets the vertical alignment of text in the cell.
|
int |
getVerticalMerge()
Specifies how the cell is merged with other cells vertically.
|
double |
getWidth()
Gets the width of the cell in points.
|
boolean |
getWrapText()
If true, wrap text for the cell.
|
void |
setBorderAttr(int key,
java.lang.Object value) |
void |
setBottomPadding(double value)
Sets the amount of space (in points) to add below the contents of cell.
|
void |
setFitText(boolean value)
If true, fits text in the cell, compressing each paragraph to the width of the cell.
|
void |
setHorizontalMerge(int value)
Specifies how the cell is merged horizontally with other cells in the row.
|
void |
setLeftPadding(double value)
Sets the amount of space (in points) to add to the left of the contents of cell.
|
void |
setOrientation(int value)
Sets the orientation of text in a table cell.
|
void |
setPaddings(double leftPadding,
double topPadding,
double rightPadding,
double bottomPadding)
Sets the amount of space (in points) to add to the left/top/right/bottom of the contents of cell.
|
void |
setPreferredWidth(PreferredWidth value)
Sets the preferred width of the cell.
|
void |
setRightPadding(double value)
Sets the amount of space (in points) to add to the right of the contents of cell.
|
void |
setTopPadding(double value)
Sets the amount of space (in points) to add above the contents of cell.
|
void |
setVerticalAlignment(int value)
Sets the vertical alignment of text in the cell.
|
void |
setVerticalMerge(int value)
Specifies how the cell is merged with other cells vertically.
|
void |
setWidth(double value)
Gets the width of the cell in points.
|
void |
setWrapText(boolean value)
If true, wrap text for the cell.
|
public void clearFormatting()
public void setPaddings(double leftPadding,
double topPadding,
double rightPadding,
double bottomPadding)
public double getLeftPadding()
public void setLeftPadding(double value)
value - The amount of space (in points) to add to the left of the contents of cell.public double getRightPadding()
public void setRightPadding(double value)
value - The amount of space (in points) to add to the right of the contents of cell.public double getTopPadding()
public void setTopPadding(double value)
value - The amount of space (in points) to add above the contents of cell.public double getBottomPadding()
public void setBottomPadding(double value)
value - The amount of space (in points) to add below the contents of cell.public BorderCollection getBorders()
public Shading getShading()
public int getVerticalAlignment()
CellVerticalAlignment constants.public void setVerticalAlignment(int value)
value - The vertical alignment of text in the cell. The value must be one of CellVerticalAlignment constants.public double getWidth()
The width is calculated by Aspose.Words on document loading and saving. Currently, not every combination of table, cell and document properties is supported. The returned value may not be accurate for some documents. It may not exactly match the cell width as calculated by MS Word when the document is opened in MS Word.
Setting this property is not recommended. There is no guarantee that the cell will actually have the set width. The width may be adjusted to accommodate cell contents in an auto-fit table layout. Cells in other rows may have conflicting width settings. The table may be resized to fit into the container or to meet table width settings. Consider using getPreferredWidth() / setPreferredWidth(com.aspose.words.PreferredWidth) for setting the cell width. Setting this property sets getPreferredWidth() / setPreferredWidth(com.aspose.words.PreferredWidth) implicitly since version 15.8.
getPreferredWidth(),
setPreferredWidth(com.aspose.words.PreferredWidth)public void setWidth(double value)
The width is calculated by Aspose.Words on document loading and saving. Currently, not every combination of table, cell and document properties is supported. The returned value may not be accurate for some documents. It may not exactly match the cell width as calculated by MS Word when the document is opened in MS Word.
Setting this property is not recommended. There is no guarantee that the cell will actually have the set width. The width may be adjusted to accommodate cell contents in an auto-fit table layout. Cells in other rows may have conflicting width settings. The table may be resized to fit into the container or to meet table width settings. Consider using getPreferredWidth() / setPreferredWidth(com.aspose.words.PreferredWidth) for setting the cell width. Setting this property sets getPreferredWidth() / setPreferredWidth(com.aspose.words.PreferredWidth) implicitly since version 15.8.
value - The width of the cell in points.getPreferredWidth(),
setPreferredWidth(com.aspose.words.PreferredWidth)public PreferredWidth getPreferredWidth()
The preferred width (along with the table's Auto Fit option) determines how the actual width of the cell is calculated by the table layout algorithm. Table layout can be performed by Aspose.Words when it saves the document or by Microsoft Word when it displays the document.
The preferred width can be specified in points or in percent. The preferred width can also be specified as "auto", which means no preferred width is specified.
The default value is PreferredWidth.AUTO.
getWidth(),
setWidth(double)public void setPreferredWidth(PreferredWidth value)
The preferred width (along with the table's Auto Fit option) determines how the actual width of the cell is calculated by the table layout algorithm. Table layout can be performed by Aspose.Words when it saves the document or by Microsoft Word when it displays the document.
The preferred width can be specified in points or in percent. The preferred width can also be specified as "auto", which means no preferred width is specified.
The default value is PreferredWidth.AUTO.
value - The preferred width of the cell.getWidth(),
setWidth(double)public int getVerticalMerge()
Cells can only be merged vertically if their left and right boundaries are identical.
When cells are vertically merged, the display areas of the merged cells are consolidated. The consolidated area is used to display the contents of the first vertically merged cell and all other vertically merged cells must be empty.
int value. The returned value is one of CellMerge constants.getHorizontalMerge(),
setHorizontalMerge(int)public void setVerticalMerge(int value)
Cells can only be merged vertically if their left and right boundaries are identical.
When cells are vertically merged, the display areas of the merged cells are consolidated. The consolidated area is used to display the contents of the first vertically merged cell and all other vertically merged cells must be empty.
value - The corresponding int value. The value must be one of CellMerge constants.getHorizontalMerge(),
setHorizontalMerge(int)public int getHorizontalMerge()
int value. The returned value is one of CellMerge constants.getVerticalMerge(),
setVerticalMerge(int)public void setHorizontalMerge(int value)
value - The corresponding int value. The value must be one of CellMerge constants.getVerticalMerge(),
setVerticalMerge(int)public int getOrientation()
TextOrientation constants.public void setOrientation(int value)
value - The orientation of text in a table cell. The value must be one of TextOrientation constants.public boolean getFitText()
boolean value.public void setFitText(boolean value)
value - The corresponding boolean value.public boolean getWrapText()
boolean value.public void setWrapText(boolean value)
value - The corresponding boolean value.public java.lang.Object getDirectBorderAttr(int key)
public java.lang.Object fetchInheritedBorderAttr(int key)
public void setBorderAttr(int key,
java.lang.Object value)
public java.lang.Object fetchInheritedShadingAttr(int key)