Revised Question to Add Clarity
When trying to incorporate a wide (wider than \columnwidth), long table (longtblr) in a twocolumn document class like article, the table will spill onto the next column instead of the next page. How can I overcome this?
Here's an MWE (adapting the longtblr example from Chapter 4 of the tablurarray package (v2023A)):
\documentclass[twocolumn]{article}
\usepackage{xcolor}
\usepackage{tabularray}
\begin{document}
\begin{longtblr}[
caption = {A Long Long Long Long Long Long Long Table},
entry = {Short Caption},
label = {tblr:test},
note{a} = {It is the first footnote.},
note{$\dag$} = {It is the second long long long long long long footnote.},
remark{Note} = {Some general note. Some general note. Some general note.},
remark{Source} = {Made up by myself. Made up by myself. Made up by myself.},
]{
colspec = {lll},
rowhead = 2, rowfoot = 1,
row{odd} = {gray9}, row{even} = {brown9},
row{1-2} = {purple7}, row{Z} = {blue7},
}
\hline
Head & Head & Head \
\hline
Head & Head & Head \
\hline
Alpha Alpha Alpha Alpha & Beta Beta Beta Beta & Gamma Gamma Gamma Gamma \
\hline
Epsilon & Zeta\TblrNote{a} & Eta \
\hline
Iota & Kappa\TblrNote{$\dag$} & Lambda \
\hline
Nu & Xi & Omicron \
\hline
Rho & Sigma & Tau \
\hline
Phi & Chi & Psi \
\hline
Alpha Alpha Alpha Alpha & Beta Beta Beta Beta & Gamma Gamma Gamma Gamma \
\hline
Epsilon & Zeta & Eta \
\hline
Iota & Kappa & Lambda \
\hline
Nu & Xi & Omicron \
\hline
Rho & Sigma & Tau \
\hline
Phi & Chi & Psi \
\hline
Alpha Alpha Alpha Alpha & Beta Beta Beta Beta & Gamma Gamma Gamma Gamma \
\hline
Epsilon & Zeta & Eta \
\hline
Iota & Kappa & Lambda \
\hline
Nu & Xi & Omicron \
\hline
Rho & Sigma & Tau \
\hline
Phi & Chi & Psi \
\hline
Alpha Alpha Alpha Alpha & Beta Beta Beta Beta & Gamma Gamma Gamma Gamma \
\hline
Epsilon & Zeta & Eta \
\hline
Iota & Kappa & Lambda \
\hline
Nu & Xi & Omicron \
\hline
Rho & Sigma & Tau \
\hline
Phi & Chi & Psi \
\hline
Alpha Alpha Alpha Alpha & Beta Beta Beta Beta & Gamma Gamma Gamma Gamma \
\hline
Epsilon & Zeta & Eta \
\hline
Iota & Kappa & Lambda \
\hline
Nu & Xi & Omicron \
\hline
Rho & Sigma & Tau \
\hline
Phi & Chi & Psi \
\hline
Alpha Alpha Alpha Alpha & Beta Beta Beta Beta & Gamma Gamma Gamma Gamma \
\hline
Epsilon & Zeta & Eta \
\hline
Iota & Kappa & Lambda \
\hline
Nu & Xi & Omicron \
\hline
Rho & Sigma & Tau \
\hline
Phi & Chi & Psi \
\hline
Alpha Alpha Alpha Alpha & Beta Beta Beta Beta & Gamma Gamma Gamma Gamma \
\hline
Epsilon & Zeta & Eta \
\hline
Iota & Kappa & Lambda \
\hline
Nu & Xi & Omicron \
\hline
Rho & Sigma & Tau \
\hline
Phi & Chi & Psi \
\hline
Foot & Foot & Foot \
\hline
\end{longtblr}
\end{document}
This produces the following output:
Original Question
I have a two column (or double column) template where I want to use longtblr for tables. I really like how tabularray (where longtblr is defined) works. It is simple, easy to use, and most of all, it looks quite nice (my subjective opinion). I used it for single column documents and also for two columnm documents with small tables. However, I don't quite get the hang of it for using it properly for wide tables which span accross two columns. Here is an example:
\documentclass[twocolumn]{article}
\usepackage{xcolor}
\usepackage{tabularray}
\NewTblrTheme{TC}{%
\DefTblrTemplate{contfoot-text}{default}{Continued on next column/page}
\SetTblrStyle{contfoot-text}{font=\footnotesize\itshape, fg=black!80}
}
\usepackage{lipsum}
\begin{document}
\lipsum[1-2]
\begin{longtblr}[
theme = TC,
caption = {Long table caption.},
label = {table:ips},
]{
hlines, vlines,
colspec = { X[l] X[2,l] X[3,l]},
rowhead = 2,
% colsep = 3pt,
row{even} = {gray9},
row{1} = {blue!30},
row{2} = {font=\small\bfseries, c}
}
\SetCell[c=3]{c} A nice Table
& & \\
Part A & Part B & Part C \\
Hmmm & This is not & what I want \\
Hmmm & This is not & what I want \\
Hmmm & This is not & what I want \\
Hmmm & This is not & what I want \\
Hmmm & This is not & what I want \\
Hmmm & This is not & what I want \\
Hmmm & This is not & what I want \\
Hmmm & This is not & what I want \\
Hmmm & This is not & what I want \\
Hmmm & This is not & what I want \\
\end{longtblr}
\lipsum[3-4]
\begin{table}
\begin{longtblr}[
theme = TC,
caption = {Long table caption.},
label = {table:ips},
]{
hlines, vlines,
colspec = { X[l] X[2,l] X[3,l]},
rowhead = 2,
% colsep = 3pt,
row{even} = {gray9},
row{1} = {blue!30},
row{2} = {font=\small\bfseries, c}
}
\SetCell[c=3]{c} A nice Table
& & \
Part A & Part B & Part C \
With a table around longtblr environment & it seems to work partially & but then it duplicates the table \
With a table* around longtblr environment & it seems to work partially & but then it duplicates the table \
\end{longtblr}
\end{table*}
\lipsum[5-12]
\end{document}
My Question: How can I make this table span two columns? Thank you very much.
If this is not possible, how can I replicate a similar table with another package that works? (Notice the alternating color between rows)
EDIT: Added a minimal example. Thanks to Zarko.






table*environment and put a regulartblrin it. – Pieter van Oostrum Jan 31 '22 at 13:51