Working with Table in Tagged PDFs

Create Table in Tagged PDF

Aspose.PDF for .NET allows creating a table in Tagged PDF documents. For working with tables, the API provides TableElement class. In order to create a table, you can use CreateTableElement() method of ITaggedContent interface. Furthermore, you can use CreateTHead(), CreateTBody() and CreateTFoot() methods of TableElement class for creating Table Head, Table Body, and Table Foot respectively. To create a table row, you can use CreateTR() method of TableRowCollectionElement class. You can also check if the created PDF document is PDF/UA compliance using the Validate() method of Document class.

The following code snippet also work with Aspose.PDF.Drawing library.

The following code snippet shows, how to create a table in the Tagged PDF document:

Style Table Element

Aspose.PDF for .NET allows styling a table in Tagged PDF document. In order to style a table, you can create a table using CreateTableElement() method of ITaggedContent interface and set style table using properties of TableElement class. The following is the list properties you can use to style a table:

The following code snippet shows how to style a table in Tagged PDF document:

Style Table Row

Aspose.PDF for .NET allows styling a table row in Tagged PDF document. In order to style a table row, you can use the properties of TableTRElement class. The following is the list properties you can use to style a table row:

  • BackgroundColor.
  • Border.
  • DefaultCellBorder.
  • MinRowHeight.
  • FixedRowHeight.
  • IsInNewPage.
  • IsRowBroken.
  • DefaultCellTextState.
  • DefaultCellPadding.
  • VerticalAlignment.

The following code snippet shows how to style a table row in the Tagged PDF document:

Style Table Cell

Aspose.PDF for .NET allows styling a table cell in Tagged PDF document. In order to style a table cell, you can use the properties of TableCellElement class. The following is the list properties you can use to style a table cell:

The following code snippet shows how to style a table cell in the Tagged PDF document:

Adjust table position

The following code snippet shows how to adjust table position in the Tagged PDF document: