我使用的是双列格式,我想让下表适合一列,并在标题行上换行。我该怎么做?谢谢。
\documentclass[10pt,twocolumn]{article}
\usepackage{array,graphicx}
\usepackage{booktabs}
\usepackage{pifont}
\usepackage{multirow}
\newcommand*\rot{\rotatebox{90}}
\begin{document}
.....
\section{Device Model}
Table shows the device scaling parameters for 45 nm down to 8 nm for the two sets of
\begin{table}
\centering
\begin {tabular}{ccccccc}
\toprule %
&Year & Tech Node (nm) & Frequency Scaling Factor (/45nm) & Vdd Scaling Factor (/45nm) &
Capacitance Scaling Factor (/45nm) & Power Scaling Factor (/45nm)\\ \otoprule %
\multirow {6}*{\rot{\textbf{ITRS}}}
& 2010 & 45 & 1.00 & 1.00 & 1.00 & 1.00 \\%\cmidrule (l){2-7}
& 2012 & 32 & 1.09 & 0.93 & 0.70 & 0.66 \\%\cmidrule (l){2-7}
& 2015 & 22 & 2.38 & 0.84 & 0.33 & 0.54 \\%\cmidrule (l){2-7}
& 2018 & 16 & 3.21 & 0.75 & 0.21 & 0.38 \\%\cmidrule (l){2-7}
& 2021 & 11 & 4.17 & 0.68 & 0.13 & 0.25 \\%\cmidrule (l){2-7}
& 2024 & 8 & 3.85 & 0.62 & 0.08 & 0.12 \\\midrule
\multirow {6}*{\rot{\textbf{Conservative}}}
& 2008 & 45 & 1.00 & 1.00 & 1.00 & 1.00 \\%\cmidrule (l){2-7}
& 2010 & 32 & 1.10 & 0.93 & 0.75 & 0.71 \\%\cmidrule (l){2-7}
& 2012 & 22 & 1.19 & 0.88 & 0.56 & 0.52 \\%\cmidrule (l){2-7}
& 2014 & 16 & 1.25 & 0.86 & 0.42 & 0.39 \\%\cmidrule (l){2-7}
& 2016 & 11 & 1.30 & 0.84 & 0.32 & 0.29 \\%\cmidrule (l){2-7}
& 2018 & 8 & 1.34 & 0.84 & 0.24 & 0.22 \\\bottomrule
\end {tabular}
\end{table}
答案1
我建议您为标题行提供更明确的结构。与@cfr 的解决方案一样,我使用tabularx
环境和修改后的列类型形式X
来使表格适合可用宽度。第三列的设置可能需要一些额外的解释:其主要列类型d
(来自dcolumn
包)用于对齐数字,但标题单元格的类型(已修改)X
允许其材料跨多行换行。
\documentclass[twocolumn]{article}
\usepackage{booktabs,multirow,graphicx,tabularx,ragged2e,dcolumn}
\newcolumntype{Y}{>{\arraybackslash\Centering\hspace{0pt}}X}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\newcommand\rot[1]{\rotatebox{90}{#1}}
\begin{document}
\begin{table}
\centering
\begin{tabularx}{\columnwidth}{@{} l c d{2.0} *{4}{Y} @{}}
\toprule %
&Year & \multicolumn{1}{Y}{Tech Node (nm)}
& \multicolumn{4}{c@{}}{Scaling Factor (/45nm)} \\
\cmidrule(l){4-7}
& & & Frequency & Vdd & Capacitance & Power\\
\toprule %
\multirow{6}*{\rot{\textbf{ITRS}}}
& 2010 & 45 & 1.00 & 1.00 & 1.00 & 1.00 \\
& 2012 & 32 & 1.09 & 0.93 & 0.70 & 0.66 \\
& 2015 & 22 & 2.38 & 0.84 & 0.33 & 0.54 \\
& 2018 & 16 & 3.21 & 0.75 & 0.21 & 0.38 \\
& 2021 & 11 & 4.17 & 0.68 & 0.13 & 0.25 \\
& 2024 & 8 & 3.85 & 0.62 & 0.08 & 0.12 \\
\midrule
\multirow{6}*{\rot{\textbf{Conservative}}}
& 2008 & 45 & 1.00 & 1.00 & 1.00 & 1.00 \\
& 2010 & 32 & 1.10 & 0.93 & 0.75 & 0.71 \\
& 2012 & 22 & 1.19 & 0.88 & 0.56 & 0.52 \\
& 2014 & 16 & 1.25 & 0.86 & 0.42 & 0.39 \\
& 2016 & 11 & 1.30 & 0.84 & 0.32 & 0.29 \\
& 2018 & 8 & 1.34 & 0.84 & 0.24 & 0.22 \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
答案2
这需要调整,因为我没有你正在使用的类,但是这里有一个模式的article
示例twocolumn
:
\documentclass[twocolumn]{article}
\usepackage{array,graphicx,tabularx,threeparttable}
\usepackage{booktabs}
\usepackage{pifont}
\usepackage{multirow}
\newcommand*\rot{\rotatebox{90}}
\begin{document}
.....
\section{Device Model}
Table shows the device scaling parameters for 45 nm down to 8 nm for the two sets of
\begin{table}
\small
\caption{Small table}
\begin{threeparttable}
\begin {tabularx}{\linewidth}{c*{6}{>{\hskip0pt}X}}
\toprule %
&Year & Tech Node (nm) & Frequency\hskip0pt\tnote{1} & Vdd\tnote{1} & Capacitance\hskip0pt\tnote{1} & Power\tnote{1} \\ \toprule %
\multirow {6}*{\rot{\textbf{ITRS}}}
& 2010 & 45 & 1.00 & 1.00 & 1.00 & 1.00 \\%\cmidrule (l){2-7}
& 2012 & 32 & 1.09 & 0.93 & 0.70 & 0.66 \\%\cmidrule (l){2-7}
& 2015 & 22 & 2.38 & 0.84 & 0.33 & 0.54 \\%\cmidrule (l){2-7}
& 2018 & 16 & 3.21 & 0.75 & 0.21 & 0.38 \\%\cmidrule (l){2-7}
& 2021 & 11 & 4.17 & 0.68 & 0.13 & 0.25 \\%\cmidrule (l){2-7}
& 2024 & 8 & 3.85 & 0.62 & 0.08 & 0.12 \\\midrule
\multirow {6}*{\rot{\textbf{Conservative}}}
& 2008 & 45 & 1.00 & 1.00 & 1.00 & 1.00 \\%\cmidrule (l){2-7}
& 2010 & 32 & 1.10 & 0.93 & 0.75 & 0.71 \\%\cmidrule (l){2-7}
& 2012 & 22 & 1.19 & 0.88 & 0.56 & 0.52 \\%\cmidrule (l){2-7}
& 2014 & 16 & 1.25 & 0.86 & 0.42 & 0.39 \\%\cmidrule (l){2-7}
& 2016 & 11 & 1.30 & 0.84 & 0.32 & 0.29 \\%\cmidrule (l){2-7}
& 2018 & 8 & 1.34 & 0.84 & 0.24 & 0.22 \\\bottomrule
\end {tabularx}
\begin{tablenotes}
\item[1]Scaling Factor (/45nm)
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
您可能也应该考虑将列与数字对齐,但我不知道课程是否已经提供了相关功能。