public void DocumentBuilderBuildTable()
{
//ExStart
//ExFor:Table
//ExFor:DocumentBuilder.StartTable
//ExFor:DocumentBuilder.InsertCell
//ExFor:DocumentBuilder.EndRow
//ExFor:DocumentBuilder.EndTable
//ExFor:DocumentBuilder.CellFormat
//ExFor:DocumentBuilder.RowFormat
//ExFor:DocumentBuilder.Write
//ExFor:DocumentBuilder.Writeln(String)
//ExFor:RowFormat.Height
//ExFor:RowFormat.HeightRule
//ExFor:CellVerticalAlignment
//ExFor:CellFormat.Orientation
//ExFor:TextOrientation
//ExFor:Table.AutoFit
//ExFor:AutoFitBehavior
//ExId:DocumentBuilderBuildTable
//ExSummary: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.FixedColumnWidths);
builder.CellFormat.VerticalAlignment = 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.RowFormat.Height = 100;
builder.RowFormat.HeightRule = HeightRule.Exactly;
builder.CellFormat.Orientation = TextOrientation.Upward;
builder.Writeln("This is row 2 cell 1");
// Insert a cell
builder.InsertCell();
builder.CellFormat.Orientation = TextOrientation.Downward;
builder.Writeln("This is row 2 cell 2");
builder.EndRow();
builder.EndTable();
//ExEnd
}