Haha… I have a wide table (not longtable) that is very wide in width (many columns),
a b c d e f g h i j k l m n
---------------------------
1 2 3 4 5 6 7 8 9 0 1 2 3 4
Now, I am looking for a smart way to let it automatically be broken into two+ tables (e.g., it could be broken at the vertical position(s) according to the \pagewidth or \linewidth)
a b c d e f g h i j
-------------------
1 2 3 4 5 6 7 8 9 0
k l m n
-------
1 2 3 4
Is this doable? 🙂
Edit:
For convenience, here is a tex file showing the WIDE table:
% !TEX TS-program = latex
\documentclass{article}
\usepackage{booktabs, multicol, multirow}
\usepackage[top=1.5in, bottom=1.5in, left=0.1in, right=0.1in]{geometry}
\begin{document}
\begin{table}[htbp]
\centering
\caption{Caption}
\begin{tabular}{cccc|cccc|cccc|cccc|cccc|cccc|cc}
\toprule
AA & BB & CC & DD & EE & FF & GG & HH & II & JJ & KK & LL & MM & NN & OO & PP & QQ & RR & SS & TT & UU & VV & WW & XX & YY & ZZ \\
\midrule
01 & 02 & 03 & 04 & 05 & 06 & 07 & 08 & 09 & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 & 21 & 22 & 23 & 24 & 25 & 26 \\
\bottomrule
\end{tabular}%
\label{tab:label}%
\end{table}%
\end{document}
Best Answer
It's easy if you invert the input order and enter the data columnwise rather than row wise (and your data is fairly regular, large entries would mess up the alignment. I used
c
here but you could fix the column with withp{..}