0

In my thesis, I create tables with tabularx and also with tabularray. Both packages are used along with the booktabs package.

I realized that when I color the rows of the tables it looks slightly different. For tabularray, the color reaches to the next cell, while there is a small gap for tabularx: Example for the tables

\documentclass{article} \usepackage[table]{xcolor} \usepackage{tabularray} \usepackage{tabularx} \usepackage{booktabs} \UseTblrLibrary{booktabs} \begin{document} \begin{tblr}{ colspec={Q[m,c,2cm] X[m,c] Q[m,c,3cm]}, row{even}={bg=gray}} \toprule a & b & c\\ \midrule a & b & c\\ a & b & c\\ a & b & c\\ \bottomrule \end{tblr} \vspace{2cm} \rowcolors{2}{}{gray} \begin{tabularx}{\textwidth}{c X c} \toprule a & b & c\\ \midrule a & b & c\\ a & b & c\\ a & b & c\\ \bottomrule \end{tabularx} \end{document} 
  1. Is it possible to get the same look for the tabularray tables as for the tabularx tables?
  2. Would you recommend using tabularray everywhere? I read that it is the recommended package now, but it would require some effort to change all the tables.
6
  • 1
    As least for colored tables I would use tabularray. And IMHO there is no very good reason to not use it also for other tables. Commented Sep 2 at 11:45
  • The easiest way to avoid the problem is to to remove the background colours. These backgrounds makes the information-to-ink-ratio much worse, see e.g. betterposters.blogspot.com/2012/08/the-data-prison.html Commented Sep 2 at 12:21
  • 1
    using coloured backgrounds alongside spaced booktabs rules seems an odd choice but colortbl rules are separate panels in each cell so there is always a chance of accidental artifacts along the boundary with small gaps at some zoom levels in some pdf viewers. drawing real rows backgrounds with tikz (tabualarray or nicematrix etc) is rather more stable) Commented Sep 2 at 13:14
  • @cabohah I think accessibility is a good reason and tabularray is not compatible with tagging, as far as I know. needing to use overleaf is another reason. Commented Sep 2 at 14:11
  • @cfr These are reasons to generally not use tabularray. But I've interpreted the second part of the question as: Using tabularray only for some or all tables. And IMHO breaking tagging only for some tables is not much better than breaking it for all tables. Commented Sep 3 at 7:00

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.