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 want to put the following table together with a other similar table in two columns

\begin{table}[h]
\centering
{\fontfamily{ptm}\selectfont{
\rowcolors{1}{}{gray!20}
\begin{tabular}{cc}
\rowcolor{LightBlue} \textsf{Plazos} & \textsf{Tasa efectiva anual}\\
\textsf{$30 - 59$ d\'ias} & \textsf{2.00 \%}\\
\textsf{$60 - 90$ d\'ias} & \textsf{2.50 \%}\\
\textsf{$91 - 180$ d\'ias} & \textsf{4.00 \%}\\
\textsf{$181 - 366$ d\'ias} & \textsf{5.00 \%}\\
\textsf{$367 - 546$ d\'ias} & \textsf{6.00 \%}\\
\textsf{$547 - 731$ d\'ias} & \textsf{8.00 \%}\\
\textsf{$732 - 1096$ d\'ias} & \textsf{9.00 \%}\\ \hline
\end{tabular}}}
\caption{Pago de intereses al vencimiento.}
\end{table}

I tried with multicols but doesn't work.

share|improve this question
    
You can't use table in a multicols environment. –  egreg Mar 7 '13 at 14:37
    
Yes, I noticed that. –  Diego Silvera Mar 7 '13 at 14:39

2 Answers 2

up vote 3 down vote accepted

Due to your comment about align tables and captions, I suggest take also a look to the subfigure, subcaption, subfig or floatrow packages for subfloat formats.

On the other hand, although is out of the question, the MWE with subfigure include also numprint, inputenc and babel packages for a better/easier formatting according to Spanish conventions.
MWE

\documentclass[spanish,11pt]{article}
\usepackage{babel}
\usepackage[table]{xcolor}
\usepackage[utf8]{inputenc}
\usepackage[normal]{subfigure}
\usepackage{numprint}

\begin{document}

\begin{table}[h]
\subtable[Cuadro original]{
{\fontfamily{ptm}\selectfont{
\rowcolors{1}{}{gray!20}
\begin{tabular}{cc}
\rowcolor{blue!30} \textsf{Plazos} & \textsf{Tasa efectiva anual}\\
\textsf{$30 - 59$ días} & \textsf{\numprint{2.00} \%}\\
\textsf{$60 - 90$ días} & \textsf{\numprint{2.50} \%}\\
\textsf{$91 - 180$ días} & \textsf{\numprint{4.00} \%}\\
\textsf{$181 - 366$ días} & \textsf{\numprint{5.00} \%}\\
\textsf{$367 - 546$ días} & \textsf{\numprint{6.00} \%}\\
\textsf{$547 - 731$ días} & \textsf{\numprint{8.00} \%}\\
\textsf{$732 - 1096$ días} & \textsf{\numprint{9.00} \%}\\ \hline
\end{tabular}}}
}
\subtable[Cuadro alargado]{
{\fontfamily{ptm}\selectfont{
\rowcolors{1}{}{gray!20}
\begin{tabular}{cc}
\rowcolor{blue!30} \textsf{Plazos} & \textsf{Tasa efectiva anual}\\
\textsf{$30 - 59$ días} & \textsf{\numprint{2.00} \%}\\
\textsf{$60 - 90$ días} & \textsf{\numprint{2.50} \%}\\
\textsf{$91 - 180$ días} & \textsf{\numprint{4.00} \%}\\
\textsf{$181 - 366$ días} & \textsf{\numprint{5.00} \%}\\
\textsf{$91 - 180$ días} & \textsf{\numprint{4.00} \%}\\
\textsf{$181 - 366$ días} & \textsf{\numprint{5.00} \%}\\
\textsf{$367 - 546$ días} & \textsf{\numprint{6.00} \%}\\
\textsf{$547 - 731$ días} & \textsf{\numprint{8.00} \%}\\
\textsf{$732 - 1096$ días} & \textsf{\numprint{9.00} \%}\\ \hline
\end{tabular}}}
}
\caption{Pago de intereses al vencimiento.}
\end{table}
\end{document}
share|improve this answer

One approach is just to put the two tabulars side-by-side (they're seen by TeX, at some point, as two large characters). Something like this:

\documentclass[a4paper]{article}
\begin{document}
\begin{table}[h]
\centering
{\fontfamily{ptm}\selectfont
%\rowcolors{1}{}{gray!20}
\begin{tabular}{cc}
\textsf{Plazos} & \textsf{Tasa efectiva anual}\\
\textsf{$30 - 59$ d\'ias} & \textsf{2.00 \%}\\
\textsf{$60 - 90$ d\'ias} & \textsf{2.50 \%}\\
\textsf{$91 - 180$ d\'ias} & \textsf{4.00 \%}\\
\textsf{$181 - 366$ d\'ias} & \textsf{5.00 \%}\\
\textsf{$367 - 546$ d\'ias} & \textsf{6.00 \%}\\
\textsf{$547 - 731$ d\'ias} & \textsf{8.00 \%}\\
\textsf{$732 - 1096$ d\'ias} & \textsf{9.00 \%}\\ \hline
\end{tabular}
\begin{tabular}{cc}
\textsf{Plazos} & \textsf{Tasa efectiva anual}\\
\textsf{$30 - 59$ d\'ias} & \textsf{2.00 \%}\\
\textsf{$60 - 90$ d\'ias} & \textsf{2.50 \%}\\
\textsf{$91 - 180$ d\'ias} & \textsf{4.00 \%}\\
\textsf{$181 - 366$ d\'ias} & \textsf{5.00 \%}\\
\textsf{$367 - 546$ d\'ias} & \textsf{6.00 \%}\\
\textsf{$547 - 731$ d\'ias} & \textsf{8.00 \%}\\
\textsf{$732 - 1096$ d\'ias} & \textsf{9.00 \%}\\ \hline
\end{tabular}}
\caption{Pago de intereses al vencimiento.}
\end{table}
\end{document}

Result

Sorry - as you didn't give a full MWE, I had to remove the \rowcolor calls, in preference to spending a lot of time discovering what packages I needed. :-)

share|improve this answer
    
@egreg : Thanks, I didn't spot that particular bit of redundancy –  Brent.Longborough Mar 7 '13 at 15:59
    
Don't worry for the colours. I have another problem, the 'other similar table' have a different hight so LaTeX centers vertically them and I'd like to put them at the same hight, the another problem is that I can't put a caption in each table without move which should be on the right to above. –  Diego Silvera Mar 7 '13 at 19:01
    
I solved the problem of the hight adding empty rows left the captions, thanks a lot for your help. –  Diego Silvera Mar 7 '13 at 20:26
    
I believe there are solutions for both of your problems -- two figures in the same float, and aligning the two tables vertically (but I'm not familiar with either, sorry) –  Brent.Longborough Mar 7 '13 at 21:04
    
I'm rather dubious about the numbers in the first column, that aren't in sans serif type and the dash is a minus sign, with probably wrong spacing. –  egreg Mar 8 '13 at 0:34

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.