我有一张四列的表格,其中有一些注释。我使用booktabs
带有垂直线的样式来分隔表格中的两个大类别(硬件和软件)。问题是第一列没有显示垂直线。
可能哪里出了问题?另外,我认为在表格中加垂直线不是一个好主意,但如果没有垂直线,内容就很难阅读;我有什么办法可以删除垂直线,但又能明显地分隔各列。
\documentclass[9pt]{article}
\usepackage{booktabs}
\newcommand{\spaceit}{\hspace{0.2cm}}
\usepackage{threeparttable}
\begin{document}
\begin{table}[t]
\caption{Research history \& directions}
\centering
\begin{threeparttable}
\begin{tabular}{@{}l|ll|ll@{}} \toprule
& \multicolumn{2}{c}{Software} & \multicolumn{2}{c}{Hardware}\\
\cmidrule(r){2-3} \cmidrule(r){4-5}
& Data structures \& Algorithms & Software Engineering & Hardware Systems & Communication\\ \midrule
A & \tnote{1}\spaceit Ray tracing modeling & Widget framework & & VLC\tnote{a} \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item[1] Published academic research: papers, books, technical reports ({1} -- {10})
\item[a] Visible Light Communication
\item[b] Component Based Software Engineering
\item[c] Data Acquisition System
\item[d] Web-based System Management
\item[e] Software \& Hardware Testing System
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
答案1
这是一种更好地区分两组的方法:
\documentclass[9pt]{extarticle}
\usepackage[showframe]{geometry}
\usepackage[table, svgnames]{xcolor}
\usepackage{booktabs, caption}
\newcommand{\spaceit}{\hspace{0.2cm}}
\usepackage{threeparttable}
\begin{document}
\begin{table}[t]
\caption{Research history \& directions}
\centering
\begin{threeparttable}
\begin{tabular}{@{}lll cll@{}}
\arrayrulecolor{black} \cmidrule[\heavyrulewidth]{2-3} \cmidrule[\heavyrulewidth]{5-6}
& \multicolumn{2}{c}{\bfseries Software} &\raisebox{0pt}[0pt][0pt]{\color{Lavender}\rule[-9.4ex]{1.5em}{12ex}} & \multicolumn{2}{c}{\bfseries Hardware}\\
\cmidrule(r){2-3} \cmidrule(r){5-6}
& Data structures \& Algorithms & Software Engineering & & Hardware Systems & Communication \\
\addlinespace
A & \tnote{1}\spaceit Ray tracing modeling & Widget framework & & VLC\tnote{a} \\
\cmidrule[\heavyrulewidth]{2-3} \cmidrule[\heavyrulewidth]{5-6}
\end{tabular}
\smallskip
\begin{tablenotes}\footnotesize
\item[1] Published academic research: papers, books, technical reports ({1} -- {10})
\item[a] Visible Light Communication
\item[b] Component Based Software Engineering
\item[c] Data Acquisition System
\item[d] Web-based System Management
\item[e] Software \& Hardware Testing System
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}