[Tex/LaTex] booktabs and tiny horizontal space

booktabsspacingtables

In a regular table, I'm trying to remove the small horizontal space before the first column and after the last one as achieved with package booktabs with the option @{}. How can I do that? Please compile the code below:

\documentclass[fleqn,11pt]{book}
\usepackage{booktabs}
\begin{document}
\begin{table}[!ht]\centering
\begin{tabular}{@{}llr@{}} \toprule
Gnat & per gram & 13.65 \\
Gnu & stuffed & 92.50 \\ \bottomrule
\end{tabular}
\end{table}
\begin{table}[!ht]\centering
\begin{tabular}{llr} \toprule
Gnat & per gram & 13.65 \\
Gnu & stuffed & 92.50 \\ \bottomrule
\end{tabular}
\end{table}
\end{document} 

Best Answer

The @{} specification in tabular works with any table. It's not specific to the booktabs package.

Here's an example with \fboxes around the table to show the boundaries.

\documentclass{article}
\begin{document}

\fbox{\begin{tabular}{ll}
foo & bar\\
bar & foo
\end{tabular}}

\fbox{\begin{tabular}{@{}ll@{}}
foo & bar\\
bar & foo
\end{tabular}}

\end{document}

output of code

Related Question