tabularray icon indicating copy to clipboard operation
tabularray copied to clipboard

Unexpected vertical align change for some cells

Open BenjaminGalliot opened this issue 1 year ago • 3 comments

Here is the MWE:

\documentclass{book}

\usepackage{tabularray}
\usepackage{xcolor}

\begin{document}

\begin{longtblr}{
  colspec = {X[c,m]X[c,m]X[c,m]},
  cell{2-3}{2-3} = {m,blue!50!white} % change here (m to b/t)
}
  \hline
  head 1 & head 2 & head 3 \\
  \hline
  {a \\ b} & {c \\ d} & e \\
  \hline
  a & {b \\ c \\ d} & e \\
  \hline
  a & {b \\ c \\ d} & {e \\ \phantom{ } \\ \phantom{ }} \\
  \hline
\end{longtblr}

% Same but without content in first column.
\begin{longtblr}{
  colspec = {X[c,m]X[c,m]X[c,m]},
  cell{2-3}{2-3} = {m,blue!50!white} % change here (m to b/t)
}
  \hline
  head 1 & head 2 & head 3 \\
  \hline
  & {c \\ d} & e \\
  \hline
  & {b \\ c \\ d} & e \\
  \hline
  & {b \\ c \\ d} & {e \\ \phantom{ } \\ \phantom{ }} \\
  \hline
\end{longtblr}

\end{document}

I don't know if I am misusing the functionality, but I would simply like to change the vertical alignment (among other things) for a range of cells, yet other cells seem to interfere:

  • the first column is also affected when it shouldn't be;
  • margins appear in colored cells due to the presence of the first column (removing its contents will change these margins in colored cells, as seen in second table).

By the way, I'm using \phantom{ } to align certain contents between cells, is it on purpose that \\ alone isn't enough?

Thanks for your help!

BenjaminGalliot avatar Oct 04 '23 12:10 BenjaminGalliot