16

how do I get \multicolumn to align left? I always get a small space at the beginning of the row. Here's a code

\documentclass[12pt]{article}

\usepackage{booktabs}
\usepackage{dcolumn}
\newcolumntype{d}[1]{D.{\mbox{.}}{#1}}      

\begin{document} 
\begin{table}       
\centering 
\begin{tabular}{@{} l d{2.3} d{2.3} @{}}                                       
\toprule \toprule                                                                                                                                                                                                                                                                                                                                     
\textbf{Benchmark} \\                                                                
$\quad $Net effect & 0.73 & 0.59  \\     
\multicolumn{3}{l}{\textbf{Benchmark}} \\                                                                
$\quad $Net effect & 0.73 & 0.59  \\     \bottomrule \bottomrule 
\end{tabular}                                                                                                                                                                                                                                     
\end{table}     

\end{document}

The second 'Benchmark' is not fully aligned to the left. How can I achieve that?

1
  • 3
    \multicolumn{3}{@{}l@{}{....} perhaps?
    – user31729
    Commented Nov 4, 2015 at 1:17

2 Answers 2

18

Note that the main tabular has the first column alignment specified as

@{} l

which removes the column spacing to the left of the left-aligned column (due to @{}). \multicolumn{.}{l} re-formats the column specification to l without the removal of the column spacing on the left. So you should either use

\begin{tabular}{ l ... }
  ...
  \multicolumn{3}{l}{..}
  ...
\end{tabular}

or

\begin{tabular}{ @{} l ... }
  ...
  \multicolumn{3}{@{} l}{..}
  ...
\end{tabular}
0
9

In your column specification you have @{} at the start: this suppresses that space to the left of the first column. You need to add this into the column specifier you pass to multicolumn. When added to your code you get the following:

\documentclass[12pt]{article}

\usepackage{booktabs}
\usepackage{dcolumn}
\newcolumntype{d}[1]{D.{\mbox{.}}{#1}}

\begin{document}
\begin{table}
\centering
\begin{tabular}{@{} l d{2.3} d{2.3} @{}}
\toprule \toprule
\textbf{Benchmark} \\
$\quad $Net effect & 0.73 & 0.59  \\
\multicolumn{3}{@{}l}{\textbf{Benchmark}} \\
$\quad $Net effect & 0.73 & 0.59  \\     \bottomrule \bottomrule
\end{tabular}
\end{table}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .