# Table with Booktabs - Cannot obtain desired result [duplicate]

This question already has an answer here:

This question is related to this post (accepted answer): Table formatting.

After compiling the code below I obtain this outcome:

I have tried several alternatives such as adding backslashes or "&" symbols but I am still unable to obtain the desired results.

Thanks in advance.

 \documentclass[a4paper,12pt]{scrreprt}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\begin{tabular}{@{} lcccc @{}} % suppress vertical whitespace at start and end
\toprule
Company& \multicolumn{3}{c}{Exceedances} & No.\ of Obs.\    \cmidrule(lr){2-4}
& \multicolumn{2}{c}{Empirical} & Expected\    \cmidrule(lr){2-3} \cmidrule(lr){4-4}
&standard & standardized\\    % make columns 2 and 3 narrower
&normal   & Student's-$t$\    \midrule
Company 1&1&5&9&13\    Company 2&2&6&10&14\    Company 3&3&11&15\    Company 4&4&8&12&16\    \midrule[\heavyrulewidth] % use "thick" \midrule instead of \bottomrule
\multicolumn{4}{@{}l}{\footnotesize An additional hint about a detail}
\end{tabular}
\caption{Here is the caption.}
\label{labelhere}
\end{table}
\end{document}


## marked as duplicate by Werner tables StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Apr 25 '17 at 3:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

• That is unfortunately a site-wide bug that was introduced; see Double backslashes disappear from code. I've corrected the code in the linked post. Once it's worked for you, we can close this question. – Werner Apr 25 '17 at 1:30
• Great, thanks a lot @Werner for letting me know about the bug as well as editing the original code! – Alan Apr 25 '17 at 1:39

## 1 Answer

You have to use a double backslash \\ for a linebreak.

\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\begin{tabular}{@{} lcccc @{}}
\toprule
Company   & \multicolumn{3}{c}{Exceedances} & No.\ of Obs.  \\
\cmidrule(lr){2-4}
& \multicolumn{2}{c}{Empirical}   & Expected      \\
\cmidrule(lr){2-3}\cmidrule(lr){4-4}
& standard                        & standardized  \\
& normal                          & Student's-$t$ \\
\midrule
Company 1 & 1 & 5  & 9                      & 13            \\
Company 2 & 2 & 6  & 10                     & 14            \\
Company 3 & 3 & 11 & 15                                     \\
Company 4 & 4 & 8  & 12                     & 16            \\
\midrule[\heavyrulewidth]
\multicolumn{4}{@{}l}{\footnotesize An additional hint about a detail}
\end{tabular}
\caption{Here is the caption.}
\label{labelhere}
\end{table}
\end{document}