在LaTeX中,可以使用longtable和tabularx包来绘制跨页横向表格。

下面是使用longtable包绘制跨页横向表格的示例代码:

\usepackage{longtable} \begin{longtable}{|p{2cm}|p{3cm}|p{4cm}|} \hline \textbf{列1} & \textbf{列2} & \textbf{列3} \ \hline \endfirsthead \multicolumn{3}{c}{续表} \ \hline \textbf{列1} & \textbf{列2} & \textbf{列3} \ \hline \endhead \hline \multicolumn{3}{c}{接下来的内容见下一页} \ \hline \endfoot \hline \endlastfoot 内容1 & 内容2 & 内容3 \ \hline 内容4 & 内容5 & 内容6 \ \hline 内容7 & 内容8 & 内容9 \ \hline ... \end{longtable}

在上述代码中,首先导入longtable包,然后使用longtable环境来定义表格,其中使用|来表示表格的竖线,p{宽度}来定义每列的宽度。在longtable环境中,使用\endfirsthead来定义第一页的表头,使用\endhead来定义除了第一页之外的表头,使用\endfoot来定义除了最后一页之外的表格脚,使用\endlastfoot来定义最后一页的表格脚。

下面是使用tabularx包绘制跨页横向表格的示例代码:

\usepackage{tabularx} \begin{tabularx}{\textwidth}{|X|X|X|} \hline \textbf{列1} & \textbf{列2} & \textbf{列3} \ \hline \endhead 内容1 & 内容2 & 内容3 \ \hline 内容4 & 内容5 & 内容6 \ \hline 内容7 & 内容8 & 内容9 \ \hline ... \end{tabularx}

在上述代码中,首先导入tabularx包,然后使用tabularx环境来定义表格,其中\textwidth表示表格的宽度,X表示自适应宽度的列。在tabularx环境中,使用\endhead来定义表头。需要注意的是,使用tabularx绘制跨页横向表格时,需要手动添加表格脚

latex跨页横向表格怎么绘制

原文地址: https://www.cveoy.top/t/topic/e2cq 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录