com.aspose.words
Class CellFormat

java.lang.Object
    extended by com.aspose.words.CellFormat

public class CellFormat 
extends java.lang.Object

Represents all formatting for a table cell.

Property Getters/Setters Summary
Aspose.Words.BorderCollectiongetBorders()
           Gets collection of borders of the cell.
doublegetBottomPadding()
voidsetBottomPadding(double value)
           Returns or sets the amount of space (in points) to add below the contents of cell.
booleangetFitText()
voidsetFitText(boolean value)
           If true, fits text in the cell, compressing each paragraph to the width of the cell.
intgetHorizontalMerge()
voidsetHorizontalMerge(int value)
           Specifies how the cell is merged horizontally with other cells in the row. The value of the property is CellMerge integer constant.
doublegetLeftPadding()
voidsetLeftPadding(double value)
           Returns or sets the amount of space (in points) to add to the left of the contents of cell.
Aspose.Words.TextOrientationgetOrientation()
           Returns or sets the orientation of text in a table cell.
PreferredWidthgetPreferredWidth()
voidsetPreferredWidth(PreferredWidth value)
           Returns or sets the preferred width of the cell.
doublegetRightPadding()
voidsetRightPadding(double value)
           Returns or sets the amount of space (in points) to add to the right of the contents of cell.
Aspose.Words.ShadinggetShading()
           Returns a Shading object that refers to the shading formatting for the cell.
doublegetTopPadding()
voidsetTopPadding(double value)
           Returns or sets the amount of space (in points) to add above the contents of cell.
intgetVerticalAlignment()
voidsetVerticalAlignment(int value)
           Returns or sets the vertical alignment of text in the cell. The value of the property is CellVerticalAlignment integer constant.
intgetVerticalMerge()
voidsetVerticalMerge(int value)
           Specifies how the cell is merged with other cells vertically. The value of the property is CellMerge integer constant.
doublegetWidth()
voidsetWidth(double value)
           Gets the width of the cell in points.
booleangetWrapText()
voidsetWrapText(boolean value)
           If true, wrap text for the cell.
 
Method Summary
voidclearFormatting()
           Resets to default cell formatting. Does not change the width of the cell.
java.lang.ObjectfetchInheritedBorderAttr(int key)
          Reserved for internal use.
java.lang.ObjectfetchInheritedShadingAttr(int key)
          Reserved for internal use.
java.lang.ObjectgetDirectBorderAttr(int key)
          Reserved for internal use.
java.util.TreeMapgetPossibleBorderKeys()
          Reserved for internal use.
voidsetBorderAttr(int key, java.lang.Object value)
          Reserved for internal use.
voidsetPaddings(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.
 

Property Getters/Setters Detail

getBorders

public Aspose.Words.BorderCollection getBorders()
Gets collection of borders of the cell.

getBottomPadding/setBottomPadding

public double getBottomPadding() / public void setBottomPadding(double value)
Returns or sets the amount of space (in points) to add below the contents of cell.

getFitText/setFitText

public boolean getFitText() / public void setFitText(boolean value)
If true, fits text in the cell, compressing each paragraph to the width of the cell.

getHorizontalMerge/setHorizontalMerge

public int getHorizontalMerge() / public void setHorizontalMerge(int value)
Specifies how the cell is merged horizontally with other cells in the row. The value of the property is CellMerge integer constant.
See Also:
VerticalMerge

getLeftPadding/setLeftPadding

public double getLeftPadding() / public void setLeftPadding(double value)
Returns or sets the amount of space (in points) to add to the left of the contents of cell.

getOrientation

public Aspose.Words.TextOrientation getOrientation()
Returns or sets the orientation of text in a table cell.

getPreferredWidth/setPreferredWidth

public PreferredWidth getPreferredWidth() / public void setPreferredWidth(PreferredWidth value)
Returns or sets the preferred width of the cell.

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.

See Also:
Width

getRightPadding/setRightPadding

public double getRightPadding() / public void setRightPadding(double value)
Returns or sets the amount of space (in points) to add to the right of the contents of cell.

getShading

public Aspose.Words.Shading getShading()
Returns a Shading object that refers to the shading formatting for the cell.

getTopPadding/setTopPadding

public double getTopPadding() / public void setTopPadding(double value)
Returns or sets the amount of space (in points) to add above the contents of cell.

getVerticalAlignment/setVerticalAlignment

public int getVerticalAlignment() / public void setVerticalAlignment(int value)
Returns or sets the vertical alignment of text in the cell. The value of the property is CellVerticalAlignment integer constant.

getVerticalMerge/setVerticalMerge

public int getVerticalMerge() / public void setVerticalMerge(int value)
Specifies how the cell is merged with other cells vertically. The value of the property is CellMerge integer constant.

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.

See Also:
HorizontalMerge

getWidth/setWidth

public double getWidth() / public void setWidth(double value)
Gets the width of the cell in points.

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 PreferredWidth for setting the cell width. Setting this property sets PreferredWidth implicitly since version 15.8.

See Also:
PreferredWidth

getWrapText/setWrapText

public boolean getWrapText() / public void setWrapText(boolean value)
If true, wrap text for the cell.

Method Detail

clearFormatting

public void clearFormatting()
Resets to default cell formatting. Does not change the width of the cell.

fetchInheritedBorderAttr

public java.lang.Object fetchInheritedBorderAttr(int key)
Reserved for internal use.

fetchInheritedShadingAttr

public java.lang.Object fetchInheritedShadingAttr(int key)
Reserved for internal use.

getDirectBorderAttr

public java.lang.Object getDirectBorderAttr(int key)
Reserved for internal use.

getPossibleBorderKeys

public java.util.TreeMap getPossibleBorderKeys()
Reserved for internal use.

setBorderAttr

public void setBorderAttr(int key, java.lang.Object value)
Reserved for internal use.

setPaddings

public 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.

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.