您好,我想在两页乳胶中绘制长表。我使用了 longtable 包,但所有内容仍然相互重叠。它看起来像图片中的那样。我的代码如下:
\usepackage{longtable}
\begin{document}
\begin{longtable}[H]
\centering
\setlength\extrarowheight{5pt}
\begin{tabular}{ |p{3.5cm}||p{3.3cm}|p{3.3cm}|p{3.3cm}| }
\hline
System parameters &Steady state simulation at cell voltage 1.35\si{V} &Steady state simulation at cell voltage 1.35\si{V} &Transient simulation \\
\hline
a &0.075 &0.075 &0.075\\
fv &823.15 &823.15 &823.15\\
dsf &136720.0729 &136720.0733 &136720.073\\
ff &60929.13415 &67052.77939 &48254.41811\\
ff &430227.8227&774469.0564&293576.401\\
ff &6930.843614 &13759.54063 &4397.631169\\
ff) &724.9280926 &759.3822837 &702.3558378\\
ff &126.9999073 &532.1625423 &138.6410601\\
ff &3.406775256 &17.32352093 &6.106443651\\
ff &0.493541105&0.651667849 &0.347160992\\
ffE (\si{mol/s}) &0.179303961 &0.911764259 &0.321391771\\
ff &778.8335281 &917.5963789 &692.7669968\\
ff &2.490772357 &2.864034271 &2.667914307\\
ff &892.1580047 &954.4744642 &857.87485\\
ff &885.8513695 &942.4909806 &853.6193071\\
ff &2.133114059 &1.433408993 &1.845442049\\
ff &1.651490524 &2.866734694 &1.152784727\\
ff&0.436040703 &0.688364718 &0.382576613\\
ff &0.751203837 &0.837535957 &0.682169459\\
ff &0.56352883 &0.476290559 &0.518885236\\
ff &197649.207 &203772.8527 &185392.804\\
ff &7655.771707 &14518.92292 &5131.232447\\
ff &126.9999073 &532.1625423 &135.8647496\\
ff &7782.771614 &15051.08546 &5267.097196\\
ff &627877.0297 &978241.9092 &480469.8634\\
dg &7782.771614 &15051.08546 &5267.097196\\
fb &635659.8013 &993292.9946 &485736.9606\\
\hline
\end{tabular}
\caption{nxxxxxxx}
\label{tab:my_label}
\end{longtable}
\end{document}
答案1
不清楚你的问题是什么(在你的 MWE 中缺少文档的序言)。无论如何,看看以下建议是否适合你:
\documentclass{article}
\usepackage{geometry}
\usepackage{makecell, xltabular}
\newcommand\mcx[1]{\multicolumn{1}{>{\centering\arraybackslash}X|}{#1}}
\usepackage{siunitx}
\begin{document}
\begingroup
\setcellgapes{3pt}
\makegapedcells
\begin{xltabular}{\linewidth}{ |l||S|S|S| }
\caption{nxxxxxxx}
\label{tab:my_label}\\
\Xhline{1pt}
\makecell[t]{System\\ parameters}
& \mcx{Steady state simulation at cell voltage \SI{1.35}{V}}
& \mcx{Steady state simulation at cell voltage \SI{1.35}{V}}
& \mcx{Transient simulation} \\
\Xhline{0.6pt}
\endfirsthead
\caption[]{nxxxxxxx} \\
\Xhline{1pt}
\makecell{System\\ parameters}
& \mcx{Steady state simulation at cell voltage \SI{1.35}{V}}
& \mcx{Steady state simulation at cell voltage \SI{1.35}{V}}
& \mcx{Transient simulation} \\
\Xhline{0.6pt}
\endhead
\Xhline{0.6pt}
\multicolumn{4}{r}{\small\textit{Continue on the next page}}
\endfoot
\Xhline{1pt}
\endlastfoot
a &0.075 &0.075 &0.075\\
fv &823.15 &823.15 &823.15\\
dsf &136720.0729 &136720.0733 &136720.073\\
ff &60929.13415 &67052.77939 &48254.41811\\
ff &430227.8227 &774469.0564 &293576.401\\
ff &6930.843614 &13759.54063 &4397.631169\\
ff) &724.9280926 &759.3822837 &702.3558378\\
ff &126.9999073 &532.1625423 &138.6410601\\
ff &3.406775256 &17.32352093 &6.106443651\\
ff &0.493541105 &0.651667849 &0.347160992\\
ffE (\si{mol/s})
&0.179303961 &0.911764259 &0.321391771\\
ff &778.8335281 &917.5963789 &692.7669968\\
ff &2.490772357 &2.864034271 &2.667914307\\
ff &892.1580047 &954.4744642 &857.87485\\
ff &885.8513695 &942.4909806 &853.6193071\\
ff &2.133114059 &1.433408993 &1.845442049\\
ff &1.651490524 &2.866734694 &1.152784727\\
ff &0.436040703 &0.688364718 &0.382576613\\
ff &0.751203837 &0.837535957 &0.682169459\\
ff &0.56352883 &0.476290559 &0.518885236\\
ff &197649.207 &203772.8527 &185392.804\\
ff &7655.771707 &14518.92292 &5131.232447\\
ff &126.9999073 &532.1625423 &135.8647496\\
ff &7782.771614 &15051.08546 &5267.097196\\
ff &627877.0297 &978241.9092 &480469.8634\\
dg &7782.771614 &15051.08546 &5267.097196\\
fb &635659.8013 &993292.9946 &485736.9606\\
\hline
\end{xltabular}
\endgroup
- 你的表格是否超过一页?如果不是,你可以使用可以插入浮动元素的
xltabular
表格环境来代替。tabularx
table
longtable
在上面使用了MWE 来代替xltabular
(它是longtable
和tabularx
表环境的组合)。- 对于水平规则,使用
makecell
包中定义的规则 - 使用包
S
中定义的列类型将数字按小数点对齐siunitx
- 我想知道您是否真的需要 9 位小数?
编辑: 如果你不喜欢小数点对齐的数字,那么可以替换
\begin{xltabular}{\linewidth}{ |l||S|S|S| }
和
\begin{xltabular}{\linewidth}{ |l||*{3}{>{\hskip 3em}X|} }
你将获得:
答案2
通过以下重新设计,避免使用垂直线,只使用一些水平线和均匀分布的白色间隙作为引导眼睛的视线,您的表格可以轻松地放在一页上:
\documentclass{article}
\usepackage{siunitx}
\sisetup{per-mode=symbol}
\usepackage{tabularx}
\usepackage{makecell}
\renewcommand{\theadfont}{\normalsize}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\caption{nxxxxxxx}
\label{tab:my_label}
\begin{tabular}{llll}
\toprule
\thead{System\\ parameters}
&\multicolumn{2}{c}{\thead{Steady state simulation \\at cell voltage}}
& \thead{Transient\\ simulation} \\
\cmidrule{2-3}
& \thead{\SI{1.35}{\V}} & \thead{\SI{1.35}{\V}} \\
\midrule
a & 0.075 & 0.075 & 0.075 \\
fv & 823.15 & 823.15 & 823.15 \\
dsf & 136720.0729 & 136720.0733 & 136720.073 \\ \addlinespace
ff & 60929.13415 & 67052.77939 & 48254.41811 \\
ff & 430227.8227 & 774469.0564 & 293576.401 \\
ff & 6930.843614 & 13759.54063 & 4397.631169 \\ \addlinespace
ff) & 724.9280926 & 759.3822837 & 702.3558378 \\
ff & 126.9999073 & 532.1625423 & 138.6410601 \\
ff & 3.406775256 & 17.32352093 & 6.106443651 \\ \addlinespace
ff & 0.493541105 & 0.651667849 & 0.347160992 \\
ffE (\si{\mol\per\s}) & 0.179303961 & 0.911764259 & 0.321391771 \\
ff & 778.8335281 & 917.5963789 & 692.7669968 \\ \addlinespace
ff & 2.490772357 & 2.864034271 & 2.667914307 \\
ff & 892.1580047 & 954.4744642 & 857.87485 \\
ff & 885.8513695 & 942.4909806 & 853.6193071 \\ \addlinespace
ff & 2.133114059 & 1.433408993 & 1.845442049 \\
ff & 1.651490524 & 2.866734694 & 1.152784727 \\
ff & 0.436040703 & 0.688364718 & 0.382576613 \\ \addlinespace
ff & 0.751203837 & 0.837535957 & 0.682169459 \\
ff & 0.56352883 & 0.476290559 & 0.518885236 \\
ff & 197649.207 & 203772.8527 & 185392.804 \\ \addlinespace
ff & 7655.771707 & 14518.92292 & 5131.232447 \\
ff & 126.9999073 & 532.1625423 & 135.8647496 \\
ff & 7782.771614 & 15051.08546 & 5267.097196 \\ \addlinespace
ff & 627877.0297 & 978241.9092 & 480469.8634 \\
dg & 7782.771614 & 15051.08546 & 5267.097196 \\
fb & 635659.8013 & 993292.9946 & 485736.9606 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}