com.aspose.words

Class CellVerticalAlignment

  • java.lang.Object
    • com.aspose.words.CellVerticalAlignment
public class CellVerticalAlignment 
extends java.lang.Object

Utility class containing constants. Specifies vertical justification of text inside a table cell.

Example:

Shows how to build a formatted table that contains 2 rows and 2 columns.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Table table = builder.startTable();

// Insert a cell
builder.insertCell();
// Use fixed column widths.
table.autoFit(AutoFitBehavior.FIXED_COLUMN_WIDTHS);

builder.getCellFormat().setVerticalAlignment(CellVerticalAlignment.CENTER);
builder.write("This is row 1 cell 1");

// Insert a cell
builder.insertCell();
builder.write("This is row 1 cell 2");

builder.endRow();

// Insert a cell
builder.insertCell();

// Apply new row formatting
builder.getRowFormat().setHeight(100);
builder.getRowFormat().setHeightRule(HeightRule.EXACTLY);

builder.getCellFormat().setOrientation(TextOrientation.UPWARD);
builder.writeln("This is row 2 cell 1");

// Insert a cell
builder.insertCell();
builder.getCellFormat().setOrientation(TextOrientation.DOWNWARD);
builder.writeln("This is row 2 cell 2");

builder.endRow();

builder.endTable();

Field Summary
static final intTOP = 0
Text is aligned at the top of a cell.
static final intCENTER = 1
Text is aligned in the middle of a cell.
static final intBOTTOM = 2
Text is aligned at the bottom of the cell.
 

    • Field Detail

      • TOP = 0

        public static final int TOP
        Text is aligned at the top of a cell.
      • CENTER = 1

        public static final int CENTER
        Text is aligned in the middle of a cell.
      • BOTTOM = 2

        public static final int BOTTOM
        Text is aligned at the bottom of the cell.