我使用supertabular
它将表格拆分为两页,但当表格延续到第二页时,它会根据延续到第二页的第一行重置表格单元格的宽度。我希望表格单元格宽度能够考虑到整个表格中单元格的内容,从而保持不变。
\documentclass[12pt]{article}
\usepackage{lipsum,supertabular}
\begin{document}
\lipsum[1-3]
\begin{supertabular}{ll}
123456789 & abcdefghijklmnopqrstuvwxyz\\
123456789 & abcdefghijklmnopqrstuvwxy\\
123456789 & abcdefghijklmnopqrstuvwx\\
123 & abcdefghijklmnopqrstuvwxyz\\
123 & abcdefghijklmnopqrstuvwxy\\
123 & abcdefghijklmnopqrstuvwx\\
123 & abcdefghijklmnopqrstuvw\\
123 & abcdefghijklmnopqrstuv\\
123 & abcdefghijklmnopqrstu\\
\end{supertabular}
\end{document}
答案1
使用longtable
而不是supertabular
会自动处理该问题。添加[l]
为选项以使表格左对齐(默认居中)。
\documentclass[12pt]{article}
\usepackage{lipsum,longtable}
\begin{document}
\lipsum[1-3]
\begin{longtable}[l]{ll}
123456789 & abcdefghijklmnopqrstuvwxyz\\
123456789 & abcdefghijklmnopqrstuvwxy\\
123456789 & abcdefghijklmnopqrstuvwx\\
123 & abcdefghijklmnopqrstuvwxyz\\
123 & abcdefghijklmnopqrstuvwxy\\
123 & abcdefghijklmnopqrstuvwx\\
123 & abcdefghijklmnopqrstuvw\\
123 & abcdefghijklmnopqrstuv\\
123 & abcdefghijklmnopqrstu\\
\end{longtable}
\end{document}