Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I know that someone already asked pretty much the same but I cannot solve the problem of centering my table after using threepartatble command for the notes.

Here it is:

\begin{table}[h!tb] 
\centering
\begin{threeparttable}[b]
\caption{Table1}
\label{one}
\begin{tabular}{l r r r} 
\toprule
\hline
\multirow{2}{*}{country} & region & county & village \\
North Africa & 13.0 & 11.0 & 7.0 \\
Central and South Africa & 2.0 & 5.0 & 7.3 \\
Middle East & 5.3 & 3.0 & 3.0 \\
Asia & 19.0 & 24.0 & 16.7 \\ 
Southern Europe & 10.6 & 4.0 & 3.0 \\
ACP countries & 43.6 & 43.0 & 46.0 \\
Unallocated & 6.5 & 10.0 & 17.0 \\
\bottomrule
\end{tabular}
\begin{tablenotes}\footnotesize
\item Source: book
\end{tablenotes}
\end{threeparttable}
\end{table}
share|improve this question
    
Welcome to TeX.SX! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). And for inline code you can use backticks ` to mark your inline code. –  Adam Liter Aug 14 '13 at 18:37
    
I get perfect centering with your input. Note that \hline is inappropriate and the \multirow is wrong. Add \midrule after the header row. –  egreg Aug 14 '13 at 21:33

1 Answer 1

Please compare this two tables if they are different in their alignment. If that is the case, please check if your packages are all up to date. If they are, we have to compare versions. For this, add \listfiles to the preamble and get the package versions from the main.log file.

\documentclass{scrartcl}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{blindtext}

\listfiles % prints the versions of all used packages to the .log file

\begin{document}
\blindtext
\begin{table}[h!tb] 
\centering
\begin{threeparttable}[b]
\caption{Table1}
\label{tab:one}
\begin{tabular}{l r r r} 
\toprule
 country & region & county & village \\
\midrule
North Africa\tnote{1} & 13.0 & 11.0 & 7.0 \\
Central and South Africa & 2.0 & 5.0 & 7.3 \\
Middle East & 5.3 & 3.0 & 3.0 \\
\bottomrule
\end{tabular}
\begin{tablenotes}\footnotesize
\item [1] Source: book
\end{tablenotes}
\end{threeparttable}
\end{table}
%
\begin{table}[h!tb] 
\centering
\caption{Table2}
\label{tab:two}
\begin{tabular}{l r r r} 
\toprule
 country & region & county & village \\
\midrule
North Africa & 13.0 & 11.0 & 7.0 \\
Central and South Africa & 2.0 & 5.0 & 7.3 \\
Middle East & 5.3 & 3.0 & 3.0 \\
\bottomrule
\end{tabular}
\end{table}
\blindtext
\end{document}
share|improve this answer
    
Thanks for the reply. What I mean is that, if not using threeparttable the table is perfectly horizontally align (centered) in the paper. when introducing the threeparttable the table (and consequently also the note) moves to the left of the paper –  Sara Tonini Aug 14 '13 at 20:21
    
I edited my example two a direct comparison of a "normal" and a threepart table. Please check your package updates if they look different. –  LaRiFaRi Aug 14 '13 at 20:31
    
the problem still persist. –  Sara Tonini Aug 14 '13 at 20:50
    
it is as if \centering is not working with threeparttable. Please help. I should hand in the paper :( –  Sara Tonini Aug 14 '13 at 20:52
    
Sorry, as egreg also wrote, it does work fine as it is. Please update everything. Check listfiles to have threeparttable in Version from 2010 (I am having 2003 and it works, too). Be sure, just to load my example with pdfLaTeX without anything else. If you put my code in your paper, I am not able to know about any redfinitions and so on. –  LaRiFaRi Aug 14 '13 at 22:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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