![将表格格式拆分为 4 个单元格](https://linux22.com/image/351453/%E5%B0%86%E8%A1%A8%E6%A0%BC%E6%A0%BC%E5%BC%8F%E6%8B%86%E5%88%86%E4%B8%BA%204%20%E4%B8%AA%E5%8D%95%E5%85%83%E6%A0%BC.png)
我想将底部两行的数字分成不同的、大小相同的列,而不是用逗号分隔。到目前为止,我的努力让我的表格看起来很糟糕。有人有什么建议吗?
\begin{table*}[]
\begin{center}
\begin{tabular}{ | c | c | c | c | c | c | c | }
\hline
& AC rGO & RTA rGO & AC & GG & LiCoO$_2$ & FC \\
\hline
Voltage Range (V) & 0 $\to$ 3.5 & 0 $\to$ 3.5 & 0 $\to$ 3.5 & 0.01 $\to$ 1 &3.5 $\to$ 4.3 & 3 $\to$ 4.3 \\
\hline
C-Rates (Ag$^{-1}$) & 0.5, 1 ,5 , 10 & 0.5, 1, 5, 10 & 0.5, 1, 5, 10 & 0.5, 1, 2, 0.5& 0.2, 0.5 &0.5, 1, 2, 0.5 \\
\hline
Cycle Counts & 10, 10, 10, 10& 10, 10, 10, 10 & 10, 10, 10, 10 & 2, 10, 10, 5 & 2, 10 & 2, 10, 10, 5 \\
\hline
\end{tabular}
\end{center}
\caption{}
\label{}
\end{table*}
答案1
类似这样?代码使用tabualarx
具有 18 个居中列的环境X
。通过使用tabularx
环境(以及\small
字体大小指令),可以将表的宽度设置为\textwidth
。
\documentclass{article}
\usepackage[a4paper,margin=2.5cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcommand\mc[1]{\multicolumn{4}{c|}{#1}}
\begin{document}
\begin{table*}
\small
\setlength\tabcolsep{3pt}
\begin{tabularx}{\textwidth}{ | c | *{4}{*{4}{C}|} cc| *{4}{C} | }
\hline
& \mc{AC rGO} & \mc{RTA rGO} & \mc{AC} & \mc{GG} & \multicolumn{2}{c|}{LiCoO$_2$} & \mc{FC} \\
\hline
Voltage Range (V) & \mc{0$\to$3.5} & \mc{0$\to$3.5} & \mc{0$\to$3.5} & \mc{0.01$\to$1} & \multicolumn{2}{c|}{3.5$\to$4.3} & \mc{3$\to$4.3} \\
\hline
C-Rates (Ag$^{-1}$) & 0.5& 1 &5 & 10 & 0.5& 1& 5& 10 & 0.5& 1& 5& 10 & 0.5& 1& 2& 0.5& 0.2& 0.5 &0.5& 1& 2& 0.5 \\
\hline
Cycle Counts & 10& 10& 10& 10& 10& 10& 10& 10 & 10& 10& 10& 10 & 2& 10& 10& 5 & 2& 10 & 2& 10& 10& 5 \\
\hline
\end{tabularx}
\end{table*}
\end{document}
答案2
尝试以下操作(顺便说一下,表格设计真的很糟糕):
\documentclass{article}
\usepackage[landscape,a4paper,margin=0cm]{geometry}
\begin{document}
\begin{table*}
\centering
\begin{tabular}{@{} | c | cccc | cccc | cccc | cccc | cccc | cc | @{}}
\hline
& \multicolumn{4}{|c|}{AC rGO} & \multicolumn{4}{c}{RTA rGO} & \multicolumn{4}{|c|}{AC} & \multicolumn{4}{c}{GG} & \multicolumn{4}{|c|}{LiCoO$_2$} & \multicolumn{2}{c|}{FC} \\
\hline
Voltage Range (V) & \multicolumn{4}{c|}{0 $\to$ 3.5} & \multicolumn{4}{c|}{0 $\to$ 3.5} & \multicolumn{4}{c|}{0 $\to$ 3.5} & \multicolumn{4}{c|}{0.01 $\to$ 1} & \multicolumn{4}{c|}{3.5 $\to$ 4.3} & \multicolumn{2}{c|}{3 $\to$ 4.3}\\\hline
C-Rates (Ag$^{-1}$) & 0.5 & 1 & 5 & 10 & 0.5 & 1 & 5 & 10 & 0.5 & 1 & 5 & 10 & 0.5 & 1 & 2 & 0.5 & 0.2 & 0.5 & 0.5 & 1 & 2 & 0.5\\\hline
Cycle Counts & 10 & 10 & 10 & 10 & 10 & 10 & 10 & 10 & 10 & 10 & 10 & 10 & 2 & 10 & 10 & 5 & 2 & 10 & 2 & 10 & 10 & 5\\ \hline
\end{tabular}
\caption{Test}\label{}
\end{table*}
\end{document}