Centering table captions?

5,457 views
Skip to first unread message

Susan

unread,
Dec 18, 2008, 9:33:16 PM12/18/08
to LaTeX Users Group
Hello! This is so silly, but I can't seem to center my table. It keeps
appearing as flush left.

I have:

\begin{table}[ht]
\centering
\begin{tabular}{c|c|c|c|c|c|c}
... table data ...
\end{tabular}
\caption{Graphs without 4-cliques.}
\label{tbl_exp_no_clq}
\end{table}

I also have randomly inserted \begin{center} \end{center} in as many
places as I possibly can. Do I need to include a particular package? I
wonder if anyone might know why my table and caption is always
appearing as flush left?

Any comments or help is appreciated!

Best,
Susan

C Hanck

unread,
Dec 19, 2008, 3:44:38 AM12/19/08
to LaTeX Users Group
Hi Susan

it works fine for me in the following minimal example---hard to say
where the problem lies in your case since you do not provide one!

- Christoph

\documentclass[12pt]{article}
\usepackage{amssymb}
\usepackage{latexsym}
\usepackage{amsfonts}
\usepackage{amsmath}

\begin{document}

\begin{table}[ht]
\centering
\begin{tabular}{c|c|c|c|c|c|c}
... table data ...
\end{tabular}
\caption{Graphs without 4-cliques.}
\label{tbl_exp_no_clq}
\end{table}

\end{document}

Susan

unread,
Dec 19, 2008, 10:42:36 AM12/19/08
to LaTeX Users Group
Ah. Now I am worried this is going to be harder then I anticipated. I
am trying to format a journal paper, and am using a special class,
which is available at:

http://www4.ncsu.edu/~hong/jsc/JSC_LaTex_2007_Mar_12.zip

Here is my little example:

\documentclass[amsthm]{elsart}

% Make sure that you include the following two packages.
\usepackage{yjsco}
\usepackage{natbib}

\usepackage{amssymb}
\usepackage{latexsym}
\usepackage{amsfonts}
\usepackage{amsmath}

\begin{document}

\begin{table}[ht]
\centering
\begin{tabular}{c|c|c|c|c|c|c}
\em Graph & \em vertices & \em edges & \em rows & \em cols & \em deg &
\em sec\\
\hline
\text{m7 (Mycielski 7)} & 95 & 755 & 64,281 & 71,726 & 1 & .46
\end{tabular}
\caption{Graphs without 4-cliques.}
\label{tbl_exp_no_clq}
\end{table}

\end{document}

If anyone can figure out why the captions are drifting off to the
left, this would be just great!!!

Best,
Susan

C Hanck

unread,
Dec 20, 2008, 4:00:04 AM12/20/08
to LaTeX Users Group
is that feature maybe part of the elsart style? have you checked
whether papers published in some elsevier journal requiring that style
are formatted accordingly?

- christoph

Gflat

unread,
Dec 20, 2008, 11:24:10 AM12/20/08
to LaTeX Users Group
Susan,

You might also look into using the threeparttable package. I find
it's a great way to align tables/captions/footnotes.

\usepackage{threeparttable}

...

\begin{table}[h!]
\begin{center}
\begin{threeparttable}
\caption{surface intensity measurements}
\begin{tabular}{ll} \hline \hline
Source & Intensity ($W/cm^2$) \\ \hline
Experiment & 1.00 \\
Tan-slab & 1.00\tnote{*} \\
CHYRA & 1.00\tnote{*} \\ \hline \hline
\end{tabular}
\begin{tablenotes}
\item[*] Does not account for transparency material.
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}%
Reply all
Reply to author
Forward
0 new messages