1

I have a problem because I cannot centere two table that are on the same line. I tried many times, with different methods but it doesn't work. The code that I use is the following.:

\begin{table}[h]
\begin{subtable}[c]{.5\textwidth}
\centering
\raggedright
\begin{tabular}{c c}
\toprule
\multicolumn{2}{c}{\textbf{Event Window +/-1 days}} \\
\midrule
Min.    & -0.0238395 \\
1st Qu. & -0.0020889 \\
Median  & +0.0005291 \\
Mean    & +0.0006262 \\
3rd Qu. & +0.0048530 \\
Max.    & +0.0190593 \\
\bottomrule
\end{tabular}
\end{subtable}%
\begin{subtable}[c]{.5\textwidth}
\centering
\raggedright
\begin{tabular}{c c}
\toprule
\multicolumn{2}{c}{\textbf{Event Window +/-5 days}} \\
\midrule
Min.    & -0.019635 \\
1st Qu. & -0.002735 \\
Median  & +0.001202  \\
Mean    & +0.000585 \\
3rd Qu. & +0.003947 \\
Max.    & +0.013458 \\
\bottomrule
\end{tabular}
\end{subtable}
\caption{Descriptive and Explorative analysis for SIX Exchange Swiss Performance Index. Source: \cite{rproject2008xx} output}
\label{table:SPI MSCI beta}
\end{table}

The result that I obtain every time is the following: enter image description here

Can somebody help me?

  • Remove \raggedrights – JouleV Apr 25 at 15:28
1

\raggedright killed \centering. So removing them will work

\documentclass{article}
\usepackage{subcaption}
\usepackage{booktabs}
\begin{document}
\begin{table}[h]
\begin{subtable}[c]{.5\textwidth}
\centering
\begin{tabular}{c c}
\toprule
\multicolumn{2}{c}{\textbf{Event Window +/-1 days}} \\
\midrule
Min.    & -0.0238395 \\
1st Qu. & -0.0020889 \\
Median  & +0.0005291 \\
Mean    & +0.0006262 \\
3rd Qu. & +0.0048530 \\
Max.    & +0.0190593 \\
\bottomrule
\end{tabular}
\end{subtable}%
\begin{subtable}[c]{.5\textwidth}
\centering
\begin{tabular}{c c}
\toprule
\multicolumn{2}{c}{\textbf{Event Window +/-5 days}} \\
\midrule
Min.    & -0.019635 \\
1st Qu. & -0.002735 \\
Median  & +0.001202  \\
Mean    & +0.000585 \\
3rd Qu. & +0.003947 \\
Max.    & +0.013458 \\
\bottomrule
\end{tabular}
\end{subtable}
\caption{Descriptive and Explorative analysis for SIX Exchange Swiss Performance Index. Source: [something] output}
\label{table:SPI MSCI beta}
\end{table}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.