Tables with column and row labels and headers

13 views
Skip to first unread message

jfir...@linfield.edu

unread,
Jul 23, 2025, 1:50:19 PM7/23/25
to PreTeXt support
I know there has been a lot of work on tables since I last updated mine. I scoured the sample article and saw lots of cool tables, but I was unclear if there is a way to label columns and rows as well as give column and row headers. An example of the type of table I have:
Screenshot 2025-07-23 at 10.36.50 AM.png
I can keep them the way they are, but the "Player" labels are just cells, as are the "H/T". This doesn't seem particularly accessible.
My current PreTeXt:
<table xml:id="T_matchpennies" >
      <title>A game matrix showing the payoff vectors</title>
      <tabular>
          <row>
           <cell></cell>
           <cell></cell>
           <cell colspan="2" halign="center">Player 2</cell>
          </row>
          <row>
            <cell></cell>
            <cell></cell>
            <cell bottom="minor" halign="center">H</cell>
            <cell bottom="minor" halign="center">T</cell>
          </row>
          <row>
            <cell>Player 1</cell>
            <cell right="minor">H</cell>
            <cell bottom="minor" right="minor"><m>(1, -1)</m></cell>
            <cell bottom="minor" right="minor"><m>(-1, 1)</m></cell>
          </row>
          <row>
            <cell></cell>
            <cell right="minor">T</cell>
            <cell bottom="minor" right="minor"><m>(-1, 1)</m></cell>
            <cell bottom="minor" right="minor"><m>(1, -1)</m></cell>
          </row>
      </tabular>
    </table>

Andrew Scholer

unread,
Jul 23, 2025, 2:41:03 PM7/23/25
to pretext...@googlegroups.com
You are correct, that is not currently possible.

Spanner heads over multiple columns ("Player 2" in your diagram) are a common feature and are described in the Chicago Manual of Style, which serves as our guide for such matters. They would be a good candidate for inclusion.

There is no analogous feature in CMoS for the spanner over the row headings. So there would need to be more work done to clearly define their role.

Andrew Scholer (he/him/his)
Computer Science Instructor
Chemeketa Community College


--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/6a6a6d53-7a77-4941-978e-014c29d5b6den%40googlegroups.com.

Alex Jordan

unread,
Jul 23, 2025, 3:03:36 PM7/23/25
to pretext...@googlegroups.com
You can do some of this.
  • Put
    row-headers="yes"
    on the tabular, and the first column will use header cells. In your example, this would capture the "Player 1" only.
  • Put
    header="yes"
    on each of the top two row elements, and all cells in those rows will be header cells. This will capture the "Player 2" and its "H" and its "T".
  • Both of these things will cause some of the empty cells in the upper left to be "th" cells in HTML. Not sure if that matters.
One thing that this leaves out:
  • Having the "Player 1" span multiple rows. PreTeXt doesn't do that at this time, for cells of any nature, not just header cells
An observation. This sort of "two-way table" is perhaps worth identifying as a structure that could have its own markup, rather than using the out-of-the-box "tabular".

Alex Jordan

unread,
Jul 23, 2025, 3:04:23 PM7/23/25
to pretext...@googlegroups.com
Oops, another thing this leaves out:
  • The "T" and "H" for Player 1 will not be header cells.
Message has been deleted

jfir...@linfield.edu

unread,
Jul 25, 2025, 10:21:09 AM7/25/25
to PreTeXt support
Thank you. I think I'll leave them as is for now. There are a lot of tables in my book. Another game theorist recently asked how I was doing my bimatrix games wanting to know if I was using a LaTeX package. Since they look good as they are, I'll wait until there are better features for them before I change them all.
Reply all
Reply to author
Forward
0 new messages