latex 让表格宽度与文本宽度相同

使用 tabular*, \hzise 或 \textwidth, 然后加上一些奇怪的符号。

举例:

\begin{table}[!ht]
\caption{Parameter values}\label{tab:parametervalues}
\begin{tabular*}{\hsize}{@{}@{\extracolsep{\fill}}lllllllllllll@{}}
\toprule
$p_{t}$  &21  &22  &20  &15  &10  &8   &5   &10  &18  &10  &14  &18\\
\midrule
$c_{t}$  &5   &13  &10  &10  &10  &10  &10  &10  &10  &10  &10  &10\\
$h_{t}$  &10  &5   &5   &5   &5   &5   &5   &5   &5   &5   &5   &5 \\
$s_{t}$  &100 &100 &100 &100 &100 &100 &100 &100 &100 &100 &100 &100\\
$d_{t}$  &30  &45  &50  &55  &45  &55  &90  &80  &90  &65  &80  &70 \\
\bottomrule
\end{tabular*}
\end{table}

该例子中的 llllll 表示左对齐,可以改为 c 居中,r 右对齐。显示效果:

猜你喜欢

转载自blog.csdn.net/robert_chen1988/article/details/79505794
今日推荐