As per the working MWE below (based on the solution https://tex.stackexchange.com/a/165337/69378), I like the simplicity of nesting a table into the cell of a parent table compared to the multirow
package. Page breaking is one of my favourite capabilities of the longtable
package and I'm wondering if it's possible to, rather than starting from longtable
and using tabular
sub-tables to create columns or tables to present greater details, use longtable
in both instances.
Since it doesn't work to use two nested instances of longtable, is it possible to patch a macro or command to let longtable nest within other longtables or does the capabilities that let it split across pages make this too complicated?
I did test using tabular
as the parent table, and tabular
as the sub-tables which works fine, so I'd guess that it's indeed particular to the longtable code even though the errors thrown look pretty generic (missing end groups and paragraph ending before complete).
%https://tex.stackexchange.com/questions/165332/creating-a-table-within-a-longtable
\documentclass{article}
\usepackage{multirow,longtable}
\begin{document}
\begin{longtable}{ l l}
\hline
Outer column & Detail column\\
\hline
a &
\begin{tabular}{l l }
A1 & B1 \\
A2 & B2 \\
A3 & B3 \\
\end{tabular}
\\
b &
\begin{tabular}{l l }
A1 & B1 \\
A2 & B2 \\
A3 & B3 \\
\end{tabular}
\\
d & etc \\
\hline
\end{longtable}
\end{document}