我怎样才能将标题与表格左侧而不是纸张对齐?!
我想把桌子稍微拉长一点。
\documentclass{article}
\begin{document}
\begin{table}[h!]
\centering
\caption{Dimensions of simulated tissue containing a malignant tumor, all dimensions are in millimeters}
\label{tabdimension}
\begin{tabular}{ccccc}
\hline
X & Y & Z & D& R \\
\hline
120 & 60 & 25 & 12 &10 \\
\hline
\end{tabular}
\end{table}
\end{document}
答案1
使用threeparttable
。此外,部分标题可以放在表格底部,作为tablenote
。使用规则booktabs
wil 在规则周围添加一些垂直填充:
\documentclass{article}
\usepackage{array, threeparttable, booktabs, caption}
\begin{document}
\begin{table}[h!]
\centering\captionsetup{font=footnotesize}
\begin{threeparttable}
\caption{Dimensions of simulated tissue containing a malignant tumor}
\label{tabdimension}
\begin{tabular}{ccccc}
\toprule
X & Y & Z & D & R \\
\midrule
120 & 60 & 25 & 12 & 10 \\
\bottomrule
\addlinespace
\end{tabular}
\begin{tablenotes}[flushleft]
\footnotesize
\item All dimensions are in mm
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
如果您希望使用两行标题,则可以使用 设置标题宽度\captionsetup
,但不能使用threeparttable
在这种情况下,解决方法是使用以下代码向表中添加新行:
\begin{table}[h!]
\centering
\captionsetup{font=footnotesize, width= 47mm}
\caption{Dimensions of simulated tissue containing a malignant tumor}
\label{tabdimension}
\begin{tabular}{ccccc}
\toprule
X & Y & Z & D & R \\
\midrule
120 & 60 & 25 & 12 & 10 \\
\bottomrule
\addlinespace
\multicolumn{5}{@{}l}{\footnotesize All dimensions are in mm}
\end{tabular}
\end{table}