Graphics, Figures & TablesProblems with the table caption

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
greenfalcon
Posts: 10
Joined: Wed Apr 21, 2010 9:47 pm

Problems with the table caption

Post by greenfalcon »

Hello everyone,

i would like to create a table that looks like the one below:

what i did to get it, was

Code: Select all

\begin{tabular}{|c|c|c|}
\hline
\textbf{Homework Assignment} & \textbf{Distribution} & \textbf{Due Date}\\
\hline
\hline

1&15.04.2010&26.04.2010\\
2&29.04.2010&10.05.2010\\
3&13.05.2010&24.05.2010\\
4&27.05.2010&07.06.2010\\
5&10.06.2010&21.06.2010\\
6&24.06.2010&05.07.2010\\
\hline
\hline

\end{tabular}

\end{center}

\parskip 14pt

\begin{center}
Table 1: All assignments must be handed in by 18.00!
\end{center}

the result does like really close, but i think there has to be a better way of getting the captioning done... i tried it, but it didnt work :/

how do i have to use \caption and \label to get it done?

thank you very much
Attachments
table_and_subtitle.PNG
table_and_subtitle.PNG (21.25 KiB) Viewed 2592 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

sbzx
Posts: 2
Joined: Thu Apr 22, 2010 3:30 pm

Problems with the table caption

Post by sbzx »

Try something like this:

Code: Select all

\begin{table}
  \begin{center}
    \begin{tabular}
     ...
    \end{tabular}
    \caption{Your caption text}
    \label{Your reference label}
  \end{center}
\end{table}
Refer to http://en.wikibooks.org/wiki/LaTeX/Tables for more info.
greenfalcon
Posts: 10
Joined: Wed Apr 21, 2010 9:47 pm

Re: Problems with the table caption

Post by greenfalcon »

thank you :)
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Problems with the table caption

Post by sommerfee »

sbzx wrote:

Code: Select all

  \begin{center}
     ...
  \end{center}
This will add unwanted vertical space. Better use \centering instead.
sbzx
Posts: 2
Joined: Thu Apr 22, 2010 3:30 pm

Problems with the table caption

Post by sbzx »

sommerfee wrote: This will add unwanted vertical space. Better use \centering instead.
Thank you, sommerfree. For some reason, I had the impression \centering and \begin{center}...\end{center} were the same, the former being a deprecated form; apparently, a beginner's mistake.
Post Reply