Subsection 4.18.6 Table Borders and Rules
You can view each cell of your table as having four borders. Or you can imagine rows and columns separated by horizontal or vertical rules. These additions to your table do not change the arrangement of information into rows and columns (a doubly-indexed data set), though you may think it makes the presentation clearer. But less is actually more.
A given <cell>
can have a border on its bottom edge, and on its right edge. This is accomplished with the @bottom
and @right
attributes. The possible values are minor
, medium
, and major
, which control thickness. (Not every conversion can produce three distinct thicknesses, so this should be considered a hint to the conversion.) A value of none
is the default behavior when the attribute is not used, but can be given explicitly.
How to get a left border on the first cell of a row? The <row>
element allows a @left
attribute which will put a border on the left end of the row, which is also the left border of the first cell.
How to get a top border on a cell? Put a bottom border on the cell above it. But what if the cell is already in the top row and has no cell above it? The relevant <col>
element allows a @top
attribute which will place the necessary border on the top-row cell.
Borders and rules verge on presentation, so we are not concerned about which cell a border (or rule) belongs to. So, generally @bottom
and @right
can be used in many places, and the exceptional @top
and @bottom
maybe used to get the missing border \(n+1\) for a vertical or horizontal sequence of \(n\) cells.
The attributes described for cells may also be used on <row>
, <col>
, and <tabular>
. For example a thick horizontal rule after two rows of headers could be accomplished with
<row header="yes">...</row>
<row header="yes" bottom="major">...</row>
We will not detail all the combinations that are possible, so experiment and you should be able to create any rational look (and some irrational ones).
www.ctan.org/pkg/booktabs