Padded Left Align for Table Columns
The eqparbox
package will solve this. Here is an example (modified from the eqparbox
documentation to have left-aligned data like you described, and to be more aesthetic by using booktabs
). (You have to run it through latex twice, for the box widths to converge.)
\documentclass{article}
\usepackage{eqparbox}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{@{}lccc@{}} \toprule
& \multicolumn{3}{c}{Sales (in millions)} \\ \cmidrule{2-4}
Product &
October & November & December \\ \midrule
Widgets & \eqparbox{oct}{55.2} &
\eqparbox{nov}{\textbf{89.2}} &
\eqparbox{dec}{57.9} \\
Doohickeys & \eqparbox{oct}{\textbf{65.0}} &
\eqparbox{nov}{64.1} &
\eqparbox{dec}{9.3} \\
Thingamabobs & \eqparbox{oct}{10.4} &
\eqparbox{nov}{8.0} &
\eqparbox{dec}{\textbf{109.7}} \\ \bottomrule
\end{tabular}
\end{document}
To make the wrapping in eqparbox
more automatic, you can do some trickery with the array
package
\documentclass{article}
\usepackage{eqparbox}
\usepackage{array}
\newsavebox{\tempbox}
\newcolumntype{Q}[1]{>{\begin{lrbox}{\tempbox}}%
c<{\end{lrbox}\eqparbox{#1}{\unhcopy\tempbox}}}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{@{}lQ{oct}Q{nov}Q{dec}@{}}
\toprule
& \multicolumn{3}{c}{Sales (in millions)} \\
\cmidrule{2-4}
Product &
\multicolumn{1}{c}{October} &
\multicolumn{1}{c}{November} &
\multicolumn{1}{c}{December} \\
\midrule
Widgets & 55.2 & 89.2 & 57.9 \\
Doohickeys & 65.0 & 64.1 & 9.3 \\
Thingamabobs & 10.4 & 8.0 & 109.7 \\
\bottomrule
\end{tabular}
\end{document}