XML Workflow: Tables! Tables! Tables!

Tables.

Tables are my bane, as they are for anyone who does layout.

And yet, they are phenomenally important in my workflow. They are convenient (for some value of convent) containers for content.

Table Rendering

Tables are rendered in a tcolorbox, with a title if the table has a title. Otherwise, the tcolorbox is just a border around the table. The table proper is rendered using a tabular (specifically tabulary, most often) environment. There can be a footnote or legend content below it.

The table components are rendered by table section type.

  • Table headers (rows marked ‘repeat heading row’) contain column headers. If a header row has only one cell…
    • … with style ‘d20 Attribute’, it has table metadata such as formatting instructions.
      • also if style ‘LaTeX’, but this is deprecated and raises warnings while processing.
    • … and is the first such row, it has the table title.
  • Table footer (last row, if the table is flagged as having a footer row) contains supplementary information. This information is presented after the table.
    • This is most often used for table footnotes, but can be used for a legend expanding on the table content.
  • Table body (everything else), contains the table rows that aren’t header or footer. These are presented in tabular form as should be expected. Column alignment is found by examining the cells in table body.

Changes to Table Use

Leaving aside the semantic abuses of tables, there are things I’d like to change in how I use them.

Tables as Sections

As described in my last post, I want to make it so tables can themselves be used as section headings.

Tables as Searchable Objects

Historically I’ve almost always used tables as document objects, containing content to be displayed. I’ve been working with some table-intensive books lately. It would be nice to have tables as top-level searchable/referenced objects, as with game objects.

Tables with Associated Text

Right now, tables have several sections, but I’d like to extend this a little.

Content-wise,I really want to show text with the table, especially when it can naturally fit under the title. This can give me a tidier way to show tables with titles and instructions or flavor text.

For example, this is the “Warm Fire Pit” table from Nord Games’ Objects of Intrigue, rendered using the current engine.

It looks fairly okay, but it can be tidier.

Of the two, I prefer the second by quite a bit.

Though I do notice I should probably reduce the left and right padding (to use the CSS term).

Or using the first few rows of a table from Mythmere’s Nomicon, I think it can be even better.

Or at least, I think it balances better.

More importantly, for now, it keeps the heading and instruction text with the table that is being described. Right now I get a lot of awkward page breaks.

This will remove the need for many section headings. With the ‘Tables as Sections’ change, though, I can still have them show up in the bookmarks.

Table Headings with Different Alignment

Today, column alignment applies to all rows in the table. This is usually what I want, but sometimes I want to vary this. Usually this happens when I’ve got a table with short heading strings but longer content strings.

Vertical Centering when Spanning Rows

I don’t often have cells spanning rows, but they do happen. Also, I use the booktabs package when rendering tables, often with rules between rows. This increases the total row heights, but the built-in centering of text in that cell doesn’t take that into account. Text in row-spanning cells tends to ride a little high, and I’d like to fix that.

Segmented Booktabs Rules

Normally the rules between rows span the entire table (except when interrupted by row-spanning cells). I’m interested in exploring an option where each cell has its own rule. I believe they should still be vertically aligned together, but I think they’ll show small gaps between the columns. Kind of a ‘negative vertical rule’ between columns.

Okay, I do like this. It will probably have greater effect in bigger tables, or more crowded tables, but this works for me.

I wonder… if I do the same thing with the heading, it could let me squeeze the column separation a little. I don’t need to here, obviously, but it’s good to know.

Render with TikZ

I’ve always used regular LaTeX tabular environments when rendering tables. TikZ appears to have fairly sophisticated support that can address some of the rendering changes described above.

Closing Comments

Tables can be very useful to the reader, if designed and presented well. From a layout perspective they can be an immense headache… but still worth it. When done well, they also can look good and be quite satisfying.

Getting there’s a bit of a slog sometimes, but can be worth it.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to Top