Generalposition of caption for tables

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
aliraza
Posts: 2
Joined: Tue Sep 02, 2008 5:28 pm

position of caption for tables

Post by aliraza »

Hi

I am a naive user as for as latex package is concerned. I have a question regarding caption setting for tables. Following is the tex code for the table, i just want to put main caption in the bottom-center, right now caption is being displayed at bottom-left of table

Code: Select all

\documentclass[10pt,twocolumn]{article} 
\usepackage{subfig}
\begin{document}

\begin{center}
\begin{table}[!ht]
\centering
\subfloat[table 1 \label{tab:1a}]{
\small
\centering
\begin{tabular}{|p{2 em}|p{3 em}|p{2 em}|}
\hline
\centering \textbf{A} &  \centering \textbf{S} &  \centering \textbf{Z} \cr
\hline   
   1 &   a & 9 \cr
\hline
   1 &   a & 9 \cr
\hline
   1 &   a & 9 \cr
\hline
\end{tabular}
}
\subfloat[table 2 \label{tab:1b}]{
\small
\centering
\begin{tabular}{|p{2 em}|p{3 em}|p{2 em}|}
\hline
\centering \textbf{A} &  \centering \textbf{S} &  \centering \textbf{Z} \cr
\hline   
   1 &   a & 9 \cr
\hline
   1 &   a & 9 \cr
\hline
   1 &   a & 9 \cr
\hline
\end{tabular}
}
\subfloat[table 3 \label{tab:1c}]{
\small
\centering
\begin{tabular}{|p{2 em}|p{3 em}|p{2 em}|}
\hline
\centering \textbf{A} &  \centering \textbf{S} &  \centering \textbf{Z} \cr
\hline   
   1 &   a & 9 \cr
\hline
   1 &   a & 9 \cr
\hline
   1 &   a & 9 \cr
\hline
\end{tabular}
}
\caption{Main caption}
\label{tab:1}
\end{table}
\end{center}
\end{document}
Thanks in advance

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

position of caption for tables

Post by Stefan Kottwitz »

Hi aliraza,

welcome to the board! Just change twocolumn into onecolumn in the first line to get the caption centered.
By the way, i would not use so much lines in tables, especially vertical lines, but that depends on the contents. If you are interested in table layout you could have a look at tabsatz and the layout of tables inside, you could get an impression even if that document is written in German language.

Stefan
LaTeX.org admin
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

position of caption for tables

Post by sommerfee »

Stefan_K wrote:welcome to the board! Just change twocolumn into onecolumn in the first line to get the caption centered.
...or use table* instead of table to get a table which spans two columns. Or use a \hspace or \par between the 2nd and 3rd subtable.

One single column is simple too small for this wide table containing three subtables in a single line. (And the caption will be centered with respect to the column width, not the table width.)

Axel
aliraza
Posts: 2
Joined: Tue Sep 02, 2008 5:28 pm

Re: position of caption for tables

Post by aliraza »

Thank you stefan_K and sommerfee for your quick reply

I want that document in twocolumn format like conference research paper

so \begin{table*} solve my problem

Thank you again
Post Reply