SetTableHeaderRowCount
Tables
Description
Says how many leading rows of a table are headers.
Syntax
Delphi
Function TPDFlib.SetTableHeaderRowCount(TableID, HeaderRowCount: Integer): Integer;Parameters
| TableID | The table, as returned by CreateTable. |
|---|---|
| HeaderRowCount | How many rows from the top are headers. 0 means none. |
Return values
| 1 | The count was taken. |
|---|---|
| 0 | The table was unknown, or the count was negative or past the last row; nothing changed. |
Remarks
Header rows are written as header cells carrying a column scope. That is what lets a reader name the heading of the value it is on, instead of reading a bare number with nothing to attach it to.
Which rows are headers is something only the caller knows, so a table that says nothing is written as all data cells rather than guessed at: a heading named wrongly is repeated against every value under it.
The count is used when the table is drawn with table tagging on (see SetAutoTagMode), and by DrawTaggedTableRows. It names headers only; repeating them at the top of each page is a separate layout decision made with DrawTaggedTableRows. Individual cells can still be given a type of their own with SetTableCellTag, which takes precedence.
Example
PDF.SetAutoTagMode(AUTOTAG_DEFAULT);
Table := PDF.CreateTable(4, 3);
PDF.SetTableHeaderRowCount(Table, 1); // the first row names the columns
PDF.DrawTableRows(Table, 50, 780, 240, 1, 0);See also
GetTableHeaderRowCount, SetTableCellTag, DrawTaggedTableRows, SetAutoTagMode