[Tex/LaTex] Format table column widths to fit single column of twocolumn document

formattingtables

I am using a two column format, and I would like the following table to fit in one column, along with text wrapping on the title row. How do I do this? Thanks.

\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}

Best Answer

I suggest you provide more explicit structure to the header row(s). As in @cfr's solution, I use a tabularx environment and a modified form of the X column type to make the table fit into the available width. The setup of the third column may need some extra explanation: its main column type is d (from the dcolumn package) to align the numbers, but the header cell is of type (modified) X to allow wrapping of its material across several lines.

enter image description here

\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}