CellVerticalAlignment Enumeration |
Specifies vertical justification of text inside a table cell.
Namespace:
Aspose.Words.Tables
Assembly:
Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntaxpublic enum CellVerticalAlignment
Public Enumeration CellVerticalAlignment
public enum class CellVerticalAlignment
type CellVerticalAlignment
Members
| Member name | Value | Description |
---|
| Top | 0 |
Text is aligned at the top of a cell.
|
| Center | 1 |
Text is aligned in the middle of a cell.
|
| Bottom | 2 |
Text is aligned at the bottom of the cell.
|
ExamplesShows 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();
builder.InsertCell();
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
builder.CellFormat.VerticalAlignment = CellVerticalAlignment.Center;
builder.Write("This is row 1 cell 1");
builder.InsertCell();
builder.Write("This is row 1 cell 2");
builder.EndRow();
builder.InsertCell();
builder.RowFormat.Height = 100;
builder.RowFormat.HeightRule = HeightRule.Exactly;
builder.CellFormat.Orientation = TextOrientation.Upward;
builder.Writeln("This is row 2 cell 1");
builder.InsertCell();
builder.CellFormat.Orientation = TextOrientation.Downward;
builder.Writeln("This is row 2 cell 2");
builder.EndRow();
builder.EndTable();
See Also