Gridlines in Tables
C1PrintDocument provides a rich and flexible set of ways to control how table borders are rendered. The way to control table borders is tightly integrated with styles. See the Styles section for more information.
Borders in tables (also known as gridlines) are controlled by two distinct groups of style properties. The first is not specific to tables. It is the Borders style attribute, which determines what borders are drawn around the four sides of any render object (text, picture, table or anything else). The Borders attribute by default is not inherited by styles of nested objects, which makes the behavior intuitive and easy to use. For example, when you set the table render object's right border to a blue line 2 points wide, this will result in the table's rightmost border being a blue 2 points wide line, but it will not affect any of the table cells' borders. Using the Style.Borders attribute, you can specify custom borders for any of the following objects in a table:
• The table itself (thus setting any of the 4 outer borders of the whole table through Table.Style.Borders).
• The table header (either its bottom or table body's top border determines the line separating the header from the table body through Table.Header.Style.Borders).
• The table body (through Table.Body.Style.Borders).
• The table footer (either its top or table body's bottom border determines the line separating the footer from the table body through Table.Footer.Style.Borders).
• Any of the table's columns (through Table.Columns(i).Style.Borders).
• Any of the table's rows (through Table.Header.Rows(i).Style.Borders, Table.Body.Rows(i).Style.Borders, or Table.Footer.Rows(i).Style.Borders).
• Any of the table's cells (though Table.Header.Cell(i,j).Style.Borders, Table.Body.Cell(i,j).Style.Borders, Table.Footer.Cell(i,j).Style.Borders, Table.Header.Rows(i).Cell(j).Style.Borders, Table.Body.Rows(i).Cell(j).Style.Borders, Table.Footer.Rows(i).Cell(j).Style.Borders).
Styles have two additional attributes which are relevant inside tables only and allow you to specify the lines used to separate rows (StyleTableCell.BorderTableHorz) and columns (StyleTableCell.BorderTableVert) in the whole table or in just one of its bands (header, body or footer). Note that these lines are not used to draw the outer borders of the table.
The following figure illustrates the relationships between borders of different elements of a table.
|