Information and discussion about graphics, figures & tables in LaTeX documents.
scipion
Posts: 1 Joined: Sun May 12, 2013 2:09 pm
Post
by scipion » Sun May 12, 2013 2:13 pm
Hello,
I have a table that isn't well centered at all. A picture of the problem is attached. I'd like the distance from the left margin to be equal to the distance from the right margin. My table code is this.
Code: Select all
\begin{table*}[!ht]
\centering
\caption{Cette table indique pour chaque méthode si elles sont statistiquement meilleures qu'un classeur ne prédisant que la classe dominante pour la base de données "Nombre d'enfants".}
\begin{tabular}{|c|c|c|c|c|c|c|} % 7 colonnes
\hline
\textbf{Méthodes} & LapRLS & LapRKLS & LRreglog & Autolog & BagOfPath & RCTK % premiere colonne
\\ \hline
\textbf{>=0.5501} & 5 & 0 & 5 & 5 & 0 & 5
\\ \hline\hline
SVM & SVMmoran & SVMgeary & LogisticReg & Logmoran & Loggeary & MultiVarLog
\\ \hline
5 & 5 & 5 & 0 & 0 & 4 & 1
\\ \hline
\end{tabular}
\end{table*}
Does anyone know how could I solve this problem ?
Attachments
table-margin-problem.png (21.12 KiB) Viewed 11550 times
Last edited by
localghost on Wed May 29, 2013 10:20 am, edited 2 times in total.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide : 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook : 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ : the first book about TikZ for perfect drawings in your LaTeX thesis
tom
Posts: 73 Joined: Thu Apr 18, 2013 4:02 am
Post
by tom » Mon May 13, 2013 12:54 pm
Hi,
The problem is not about centering, the table is too wide and reaches into the margin. You could do one of the following:
Decrease the font size
Decrease column title lengths (e.g. by adding line breaks)
Rotate the table (e.g. by rotating)
alainremillard
Posts: 45 Joined: Fri Mar 16, 2012 8:22 pm
Post
by alainremillard » Mon May 13, 2013 5:28 pm
As Tom said, the table is too wide to fit in the text. An other solution with the help of the
\makebox
command. I added it in your code.
Code: Select all
\begin{table*}[h!] \centering
\caption{Cette table indique pour chaque méthode si elles sont statistiquement meilleures qu'un classeur ne prédisant que la classe dominante pour la base de données "Nombre d'enfants".}
\makebox[\linewidth]{
\begin{tabular}{|c|c|c|c|c|c|c|} % 7 colonnes
\hline
\textbf{Méthodes} & LapRLS & LapRKLS & LRreglog & Autolog & BagOfPath & RCTK % premiere colonne
\\ \hline
\textbf{>=0.5501} & 5 & 0 & 5 & 5 & 0 & 5
\\ \hline\hline
SVM & SVMmoran & SVMgeary & LogisticReg & Logmoran & Loggeary & MultiVarLog
\\ \hline
5 & 5 & 5 & 0 & 0 & 4 & 1
\\ \hline
\end{tabular}
}
\end{table*}
Have a nice day
Alain Rémillard