LaTeX 表格调整尺寸:使用 \resizebox 命令
\begin{table}[H]\caption{箱装情况}\resizebox{0.5\textwidth}{!}{\begin{tabular}{ccccccc}\hline\textbf{容器编号} & \textbf{5} & \textbf{6} & \textbf{7} & \textbf{8} & \textbf{9} & \textbf{总计} \hline\textbf{耗材数量} & 743& 798 & 812 & 2813 & 246 & 5412 \textbf{耗材体积} & 557250000 & 1173060000 & 2436000000 & 9564200000 & 2066400000 & 15796910000\hline\end{tabular}}\end{table}您可以使用\resizebox命令将表格调整为更小的尺寸。在导言区添加\usepackage{graphicx},然后将表格的代码包装在\resizebox{<width>}{<height>}{<table code>}中,指定所需的宽度和高度。例如,以下是将表格缩小为50%大小的示例:\begin{table}[H]\caption{箱装情况}\resizebox{0.5\textwidth}{!}{\begin{tabular}{ccccccc}\hline\textbf{容器编号} & \textbf{5} & \textbf{6} & \textbf{7} & \textbf{8} & \textbf{9} & \textbf{总计} \hline\textbf{耗材数量} & 743& 798 & 812 & 2813 & 246 & 5412 \textbf{耗材体积} & 557250000 & 1173060000 & 2436000000 & 9564200000 & 2066400000 & 15796910000\hline\end{tabular}}\end{table}在上面的示例中,\resizebox{0.5\textwidth}{!}{...}将表格调整为页面宽度的50%。您可以根据需要调整此百分比来缩放表格。
原文地址: https://www.cveoy.top/t/topic/p6EC 著作权归作者所有。请勿转载和采集!