I have looked all over the net for this. I have two tables side by side and have done this using the minipage argument. The problem is that the caption for the tables are not center aligned. Reference http://texblog.wordpress.com/2007/08/01 ... -minipage/
Can someone help me with centering the caption of each of the tables.
Thanking you,
Mehrzad
Graphics, Figures & Tables ⇒ Centering caption in \minipage
NEW: TikZ book now 40% off at Amazon.com for a short time.

Centering caption in \minipage
Hi there,
Have you tried switching the order of the environment. Meaning,
I just find it very peculiar to enter a minipage environment inside a table. Intuitively, I would create a minipage and then create a table.
Cheers
Have you tried switching the order of the environment. Meaning,
Code: Select all
\begin{minipage}[b]{0.5\linewidth}
\begin{table}[ht]
\centering
\begin{tabular}{|c|c|c|}
\hline
1&1&1\\
\hline
2&2&2\\
\hline
\end{tabular}
\end{table}
\end{minipage}
\hspace{0.5cm}
\begin{minipage}[b]{0.5\linewidth}
\begin{table}[ht]
\centering
\begin{tabular}{|c|c|c|}
\hline
1&1&1\\
\hline
2&2&2\\
\hline
\end{tabular}
\end{table}
\end{minipage}
Cheers
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Centering caption in \minipage
There's nothing unusual in this method. Some well known packages internally exactly proceed this way.fatra2 wrote:[...] I just find it very peculiar to enter a minipage environment inside a table. [...]
I can't see the problem. The method of your reference works fine.i.mehrzad wrote:I have looked all over the net for this. I have two tables side by side and have done this using the minipage argument. The problem is that the caption for the tables are not center aligned. [...]
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}
\usepackage{booktabs}
\begin{document}
\begin{table}[!ht]
\begin{minipage}[t]{0.5\linewidth}
\caption{default}\label{tab:table1}
\centering
\begin{tabular}{cc}\toprule
Table head & Table head \\ \midrule
Some values & Some values \\
Some values & Some values \\
Some values & Some values \\ \bottomrule
\end{tabular}
\end{minipage}
\hspace{0.5cm}
\begin{minipage}[t]{0.5\linewidth}
\caption{default}\label{fig:table2}
\centering
\begin{tabular}{cc}\toprule
Table head & Table head \\ \midrule
Some values & Some values \\
Some values & Some values \\
Some values & Some values \\ \bottomrule
\end{tabular}
\end{minipage}
\end{table}
\end{document}
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10