8

This table is perfect for me except for the space left at the end:

enter image description here

How can I eliminate it? @{} doesn't work!

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{makecell}

\usepackage[british]{babel}
\begin{document}

\begin{tabular}{@{}l*{3}{S[table-format=3]}@{}}
    \toprule 
     & \multicolumn{1}{c}{Lions} &  \multicolumn{1}{c}{Ducks} & \multicolumn{1}{l}{\makecell{Ducks and\\ Lions}} \tabularnewline
    \midrule
    Tizio & 1 & 10 & 100\tabularnewline
    Caio & 20 & 200 & 2\tabularnewline
    Sempronio & 300 & 3 & 30\tabularnewline
    \bottomrule
\end{tabular}

\end{document}
6

You need the \multicolumn spec to include @{}:

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{makecell}

\usepackage[british]{babel}
\begin{document}

\begin{tabular}{@{}l*{3}{S[table-format=3]}@{}}
    \toprule 
     & \multicolumn{1}{c}{Lions} &  \multicolumn{1}{c}{Ducks} & \multicolumn{1}{l@{}}{\makecell{Ducks and\\ Lions}} \tabularnewline
    \midrule
    Tizio & 1 & 10 & 100\tabularnewline
    Caio & 20 & 200 & 2\tabularnewline
    Sempronio & 300 & 3 & 30\tabularnewline
    \bottomrule
\end{tabular}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.