0

When creatin table with tabularray, for some reason it won't be made from continuous lines, but there will be a 2-3 pixel gaps between each column. Can this issue be fixed? It's not really noticeable, but when using classic table there are no gaps at all.

\documentclass{article}
\usepackage{graphicx}
\usepackage{xcolor,colortbl}
\usepackage{multirow}
\usepackage{hhline}
\definecolor{rowcol}{rgb}{0.7, 0.7, 0.7}

\usepackage{tabularray}

\title{TEST2}
\author{Anon}
\date{May 2023}

\begin{document}

\maketitle

\section{Introduction}
\begin{table}
\centering
\begin{tblr}{
  colspec={Q[c,m] Q[c,m] Q[c,m] Q[c,m] Q[c,m]},
  cells={font=\large},
  cell{1}{1} = {r=2}{c},
  cell{1}{1} = {c=1}{c},
  cell{1}{2} = {c=4}{c},
  hline{1-Z}={1}{-}{leftpos=0, rightpos=0},
  hline{3}={2}{-}{leftpos=0, rightpos=0},
  vlines,
  vline{2}={2}{-}{},
  row{odd[3]}={bg=rowcol}
}
  & Description \\
  & 1 & 2 & 3 & 4 \\
  A & 10 & 20 & 30 & 40 \\
  B & 15 & 25 & 35 & 25 \\
  C & 12 & 22 & 32 & 80 \\
\end{tblr}
\caption{Table caption}
\label{tabularraytablelabel}
\end{table}

\end{document}

1 Answer 1

1

Although I am not sure if this is what you are looking for, I post this solution, hoping that will help you:

\documentclass{article}
\usepackage{graphicx}
\usepackage{xcolor,colortbl}
\usepackage{multirow}
\usepackage{hhline}
\definecolor{rowcol}{rgb}{0.7, 0.7, 0.7}

\usepackage{tabularray}

\title{TEST2}
\author{Anon}
\date{May 2023}

\begin{document}
    
    \maketitle
    
    \section{Introduction}
    \begin{table}
        \centering
        \begin{tblr}{
                colspec={Q[c,m]Q[c,m]Q[c,m]Q[c,m]Q[c,m]},
                cells={font=\large},
                cell{1}{1} = {r=2}{c},
                cell{1}{1} = {c=1}{c},
                cell{1}{2} = {c=4}{c},
                hlines, %<-- added
                hline{1-Z}={1}{1}{leftpos=1, rightpos=0.15},%<-- added
                hline{1-Z}={1}{2}{leftpos=0.15, rightpos=1}, %<-- changed
                hline{3}={2}{-}{solid}, %<-- added
                hline{3}={2}{1}{leftpos=1, rightpos=0.15},%<-- changed
                hline{3}={2}{2}{leftpos=0.15, rightpos=1}, %<-- added
                vlines,
                vline{2}={2}{-}{},
                row{odd[3]}={bg=rowcol}
            }
            & Description \\
            & 1 & 2 & 3 & 4 \\
            A & 10 & 20 & 30 & 40 \\
            B & 15 & 25 & 35 & 25 \\
            C & 12 & 22 & 32 & 80 \\
        \end{tblr}
        \caption{Table caption}
        \label{tabularraytablelabel}
    \end{table}
    
\end{document}

output

1
  • 1
    I don't know what have you done but it indeed looks like proper table now, so I guess case is solved.
    – walter54
    Commented Jun 2, 2023 at 12:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .