Tables – How to Combine Cells in Tabularray

multicolumntablestabularray

As the title suggests, I'd like to combine two cells to lie within one column.

Table

The columns 2,3 and 4,5 should go under Kalibrierungswerte and 6,7 and 8,9 should go below Unbekannte Lösung. Now, the cell{2}{3,5} = {c=2}{c} part is supposed to achieve just that but it doesn't work. Here's the post I took the aforementioned code part from: tabularray and new command for \multicolumn cells.
And here's the code example.

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{tabularray}
    \UseTblrLibrary{booktabs, siunitx}
\usepackage[a3paper]{geometry}
%\usepackage{showframe}

\begin{document}

\begin{table}[ht!]
\begin{talltblr}[
  caption = {Pipettierschema Teilversuch 1 },
  label = {tab:ps1},
  cell{2}{3,5} = {c=2}{c},
]{colspec = {
                        %@{}
                            l c c c c c
                        @{}
                        },
             row{1,2}  = {guard, m, cmd=\hskip0pt},
            }
\toprule
 & Referenz & Kalibrierungswerte & & Unbekannte Lösung & \\ 
        nº & 1 & 2,3 & 4,5 & 6,7 & 8,9 \\ 
\midrule
        Na-Diphosphatpuffer mit Semicarbazid & 1850 & 1850 & 1850 & 1850 & 1850 \\ 
        5 mM NAD+ & 250 & 250 & 250 & 250 & 250 \\ 
        6,25 mM Ethanol & 50 & 50 & 25 & - & - \\ 
        Unbekannte Ethanol-Lösung & - & - & - & 50 & 25 \\ 
        Wasser & 350 & 300 & 325 & 300 & 325 \\ 
        ADH & - & 50 & 50 & 50 & 50 \\ 
        Verdünnung & - & 1:50 & 1:100 & 1:50 & 1:100 \\ 
\bottomrule
\end{talltblr}
\end{table}

\end{document}

Best Answer

Your problem may be because you put the cell merge instruction cell{1}{3, 5}={c=2}{c} (I suppose you've misprinted cell{2}...) in the outer specification of the tblr, in other words, in square brackets. I just moved it into inner specification, and also added the instruction hspan=even to evenly distribute column's width under spanned cells. Here is the code

\documentclass{article}
%\usepackage[ngerman]{babel}
\usepackage{tabularray}
    \UseTblrLibrary{booktabs, siunitx}
\usepackage[a3paper]{geometry}
%\usepackage{showframe}

\begin{document}

\begin{table}[ht!]
\begin{talltblr}[
  caption = {Pipettierschema Teilversuch 1},
  label = {tab:ps1},
]{         
           cell{1}{3,5} = {c=2}{c},
           hspan=even,
           colspec = {
                        %@{}
                        l c c c c c
                        @{}
                     },
           row{1,2}  = {m, cmd=\hskip0pt},
 }
\toprule
 & Referenz & Kalibrierungswerte & & Unbekannte Lösung & \\ 
        nº & 1 & 2,3 & 4,5 & 6,7 & 8,9 \\ 
\midrule
        Na-Diphosphatpuffer mit Semicarbazid & 1850 & 1850 & 1850 & 1850 & 1850 \\ 
        5 mM NAD+ & 250 & 250 & 250 & 250 & 250 \\ 
        6,25 mM Ethanol & 50 & 50 & 25 & - & - \\ 
        Unbekannte Ethanol-Lösung & - & - & - & 50 & 25 \\ 
        Wasser & 350 & 300 & 325 & 300 & 325 \\ 
        ADH & - & 50 & 50 & 50 & 50 \\ 
        Verdünnung & - & 1:50 & 1:100 & 1:50 & 1:100 \\ 
\bottomrule
\end{talltblr}
\end{table}

\end{document}

I hope the result is satisfactory

output of the code above

P.S. In my code guard color and \usepackage[ngerman]{babel} have been thrown out as I don't have necessary packages in my TeX installation.