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 have another problem with a table in my document. The following code centers the caption but not the table itself. Any hints why?

\begin{table}[htbp]
\begin{tikzpicture}
\node (table) [inner sep=0pt] {
\begin{tabular}{l|l|l}
  \textbf{Class} & \textbf{Package} & \textbf{Project} \\
\hline
FANIN & CALLS & CALLS\\
FANOUT & NOM & AHH\\
CALLS & NOP & ANDC\\
HIT (only root classes) & & NOC\\
NDC & & NOP\\
NOA & & \\
NOM & & \\
NOPAR & & \\
\end{tabular}
};
\draw [rounded corners=.5em] (table.north west) rectangle (table.south east);
\end{tikzpicture}
\caption{Metrics provided by the webservice}
\label{tbl:web_service_metrics}
\end{table}
share|improve this question

1 Answer 1

up vote 7 down vote accepted

Well, you haven't used \centering (for example) to center the tikzpicture environment containing your table, so the table won't be centered; on the other hand, the standard \caption command centers its argument if it fits in one line. Simply add a \centering command right after \begin{table}[htbp]

share|improve this answer

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.