我读了所有内容,但仍然无法缩小表格宽度。尝试了所有解决方案,但都不起作用,或者大多数结果相同。这不应该被关闭。我的代码不同,解决方案不起作用!!!!
\documentclass[review]{elsarticle}
\begin{table}[H]
\centering
\caption{Printing parameters}
\begin{tabular}{ccccccccc}
& Layer height, mm & First layer speed, mm/s &Printing speed, mm/s & Extruder temperature, °C & Bed temperature, °C & Extrusion multiplier & Extrusion width, mm & Fan speed, \% \\ \hline
Carbon fiber tow& & & & & & & &
\end{tabular}
\label{table3}
\end{table}
\begin{table}[H]
\centering
\caption{Printing parameters}
\begin{tabular}{ccccccccc}
& Layer height, mm & First layer speed, mm/s &Printing speed, mm/s & Extruder temperature, °C & Bed temperature, °C & Extrusion multiplier & Extrusion width, mm & Fan speed, \% \\ \hline
Carbon fiber tow& & & & & & & &
\end{tabular}
\label{table3}
\end{table}
\begin{table}[H]
\centering
\caption{Printing parameters}
\begin{tabular}{*{9}{c}}
& Layer height, mm & First layer speed, mm/s &Printing speed, mm/s & Extruder temperature, °C & Bed temperature, °C & Extrusion multiplier & Extrusion width, mm & Fan speed, \% \\ \hline
Carbon fiber tow& & & & & & & &
\end{tabular}
\label{table3}
\end{table}
答案1
结合 (a) 允许在标题单元格中换行,(b) 允许较长单词的连字符,(c) 选择比平常更少的列间空白填充量,(d) 切换到\footnotesize
,以及 (e) 将测量单位放在单独的行中,就可以完成工作。哦,我会使用包\si
的宏siunitx
来排版测量单位。
\documentclass[review]{elsarticle}
\usepackage[T1]{fontenc}
\usepackage{setspace,tabularx,ragged2e,booktabs}
\newcolumntype{L}{>{\RaggedRight\hspace{0pt}}X} % allow hyphenation and linebreaking
\newcolumntype{C}{>{\Centering\hspace{0pt}}X} % allow hyphenation and linebreaking
\usepackage[per-mode=symbol]{siunitx} % for "\si" macro
\begin{document}
\begin{table}[h!]
\setstretch{1.0}
\setlength\tabcolsep{2.5pt} % default is 6pt
\footnotesize % to match font size size of caption
\caption{Printing parameters} \label{table3}
\medskip
\begin{tabularx}{\textwidth}{@{} L *{8}{C} @{}}
\toprule
& Layer height & First layer speed & Printing speed & Extruder temperature
& Bed temperature & Extrusion multiplier & Extrusion width & Fan speed \\
& [\si{\milli\meter}] & [\si{\milli\meter\per\second}]
& [\si{\milli\meter\per\second}] & [\si{\celsius}]
& [\si{\celsius}] & & [\si{\milli\meter}] & [\%] \\
\midrule
Carbon fiber tow & & & & & & & & \\
\addlinespace
Something else & & & & & & & & \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}