PdfFlowTableBuilder Class
Builds a table of a flow document: its columns, its header rows (repeated on each page the table continues on) and its rows. A row and the rows its cells span stay on one page.
public sealed class PdfFlowTableBuilderProperties
| Name | Description |
|---|---|
| BorderColor | Gets or sets the color of the borders. The default is gray. |
| BorderWidth | Gets or sets the width of the borders of the cells, in points; 0 for none. The default is 0.5. |
| CellPadding | Gets or sets the space between the borders and the content of the cells, in points. The default is 4. |
| HeaderBackground | Gets or sets the background of the header rows, or null for none. The default is light gray. |
BorderColor
PdfFlowTableBuilder.csBorderWidth
PdfFlowTableBuilder.csGets or sets the width of the borders of the cells, in points; 0 for none. The default is 0.5.
public double BorderWidth { get; set; }CellPadding
PdfFlowTableBuilder.csGets or sets the space between the borders and the content of the cells, in points. The default is 4.
public double CellPadding { get; set; }HeaderBackground
PdfFlowTableBuilder.csMethods
| Name | Description |
|---|---|
| Columns(ReadOnlySpan<double>) | Sets the relative widths of the columns: the width of the table is divided in proportion. Without it, the columns of the first row have equal widths. |
| HeaderRow(Action<PdfFlowRowBuilder>) | Adds a header row: its cells are header cells (TH) of their columns. |
| HeaderRow(IEnumerable<string>) | Adds a header row of texts: its cells are header cells (TH) of their columns. |
| Row(Action<PdfFlowRowBuilder>) | Adds a row. |
| Row(IEnumerable<string>) | Adds a row of texts. |
Columns(ReadOnlySpan<double>)
PdfFlowTableBuilder.csSets the relative widths of the columns: the width of the table is divided in proportion. Without it, the columns of the first row have equal widths.
public PdfFlowTableBuilder Columns(params scoped ReadOnlySpan<double> weights)Parameters
weightsReadOnlySpan<double>- The weights, one per column.
Returns
PdfFlowTableBuilder The builder.
Exceptions
ArgumentException- A weight is not positive, or there is none.
HeaderRow overloads
HeaderRow(Action<PdfFlowRowBuilder>)
PdfFlowTableBuilder.csAdds a header row: its cells are header cells (TH) of their columns.
public PdfFlowTableBuilder HeaderRow(Action<PdfFlowRowBuilder> build)Parameters
buildAction<PdfFlowRowBuilder>- The function that adds the cells.
Returns
PdfFlowTableBuilder The builder.
Exceptions
InvalidOperationException- A row that is not a header row was added before.
HeaderRow(IEnumerable<string>)
PdfFlowTableBuilder.csAdds a header row of texts: its cells are header cells (TH) of their columns.
public PdfFlowTableBuilder HeaderRow(params IEnumerable<string> cells)Row overloads
Row(Action<PdfFlowRowBuilder>)
PdfFlowTableBuilder.csAdds a row.
public PdfFlowTableBuilder Row(Action<PdfFlowRowBuilder> build)Parameters
buildAction<PdfFlowRowBuilder>- The function that adds the cells.
Returns
PdfFlowTableBuilder The builder.
Row(IEnumerable<string>)
PdfFlowTableBuilder.csAdds a row of texts.
public PdfFlowTableBuilder Row(params IEnumerable<string> cells)