除了末尾剩余的空间外,这个表对我来说很完美:
我该如何消除它?@{}
不起作用!
\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}
答案1
您需要的\multicolumn
规范包括@{}
:
\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}