我怎样才能减少这个表格的宽度?
\documentclass[11pt]{report}
\usepackage[eulermath]{classicthesis}
\usepackage[top=1in, bottom=1in, left=1.2in, right=1in]{geometry}
\pagestyle{plain}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\begin{document}
\begin{table} [h]
\centering
\begin{tabular}{cccc}
\toprule
\textbf{Materials} & \textbf{N. plies} &\textbf{Plies orientation}
&\textbf{Conductivity W/mK} \\
\midrule
Glass fiber+carbon fiber/epoxy resin & 9 & Isotropic glass fiber +
unidirectional carbon fiber & Resulted from experimental campaign \\
\bottomrule
\end{tabular}
\caption{Hybrid plate's characteristics.}
\end{table}
\end{document}
答案1
既然您加载了该tabularx
包,您不妨利用它的机制并允许在 4 列中的 3 列中换行。
\documentclass[11pt]{report}
\usepackage[eulermath]{classicthesis}
\usepackage[vmargin=1in, left=1.2in, right=1in]{geometry}
\pagestyle{plain}
%% \usepackage[utf8]{inputenc} % that's the default nowadays
\usepackage{tabularx,ragged2e}
\newcolumntype{L}{>{\RaggedRight}X}
\usepackage{siunitx} % for '\si' macro
\begin{document}
\begin{table}[h]
\begin{tabularx}{\textwidth}{@{} LcLL @{}}
\toprule
Materials & No.\ plies & Plies orientation &
Conductivity (\si[per-mode=symbol]{\watt\per\milli\kelvin}) \\
\midrule
Glass fiber + carbon fiber\slash epoxy resin &
9 &
Isotropic glass fiber + unidirectional carbon fiber &
Resulted from experimental campaign \\
\bottomrule
\end{tabularx}
\caption{Hybrid plate's characteristics.}
\end{table}
\end{document}
答案2
Mico 的好答案的一个变体:在多行单元格中悬挂段落将有助于区分表格行。
\documentclass[11pt]{report}
\usepackage[eulermath]{classicthesis}
\usepackage[top=1in, bottom=1in, left=1.2in, right=1in]{geometry}
\usepackage[english]{babel}
%\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\usepackage{siunitx}
\usepackage{ragged2e}
\sisetup{
per-mode=symbol,
bracket-unit-denominator=false,
}
\pagestyle{plain}
\begin{document}
\begin{table}[htp]
\newcolumntype{Y}{>{\RaggedRight\arraybackslash\leftskip=1em\parindent=-1em}X}
\newcommand{\splitcell}[1]{%
\smash{\begin{tabular}[t]{@{}c@{}}#1\end{tabular}}%
}
\begin{tabularx}{\textwidth}{YcYY}
\toprule
Materials &
\multicolumn{2}{c}{Plies} &
\multicolumn{1}{c}{\splitcell{Conductivity \\ (\unit{\watt\per\meter\per\kelvin})}} \\
\cmidrule(lr){2-3}
& No. & \multicolumn{1}{c}{Orientation} \\
\midrule
Glass fiber+carbon fiber/epoxy resin &
9 &
Isotropic glass fiber + unidirectional carbon fiber &
Resulted from experimental campaign \\
\bottomrule
\end{tabularx}
\caption{Hybrid plate's characteristics.}
\end{table}
\end{document}
我在本地定义了一个列类型以便于输入表格规范,还定义了一个用于多行标题的本地命令。
所有\leftskip=1em
行都缩进,但\parindent=-1em
第一行将从左侧 1em 开始,因此我们得到了悬挂缩进。