3

I have written code for a three column table, but it extends beyond the column margin. How can I fit it in the double column setting of my document.

\begin{table}
\centering
\begin{tabular}{|c|c|c| }
\hline
\textbf{Original Pair }&\textbf{ Mapped  Pair}&
\textbf{Favourable/Alternative}\\
\hline
 a,a & e,g & Favourable \\
 \hline
 b,b & e,c & Favourable\\
\hline
c,c & g,e & Favourable  \\ 
\hline 
d,d & h,f   & Favourable\\ 
\hline 
a,c & a,c & Favourable\\
\hline
c,a & c,a  & Favourable\\ 
\hline 
b,d & b,d & Favourable  \\
\hline 
d,b & d,b & Favourable   \\ 
\hline 
a,b & e,c & Alternative\\
\hline
a,d & a,g & Alternative  \\
\hline
 b,a & e,g & Alternative \\
\hline
b,c & a,c & Alternative\\
\hline
c,b & g,a  & Alternative \\ 
\hline 
c,d & c,e   & Alternative \\ 
\hline 
d,a & d,f  & Alternative  \\ 
\hline 
d,c & h,b  & Alternative \\ 
\hline 
\end{tabular}
\end{table}

2 Answers 2

4

You can use \begin{table*}...\end{table*}(note the *) to make the float take up both columns, or you can fit the float in one column using tabulary. For example:

enter image description here

\documentclass[twocolumn]{article}
\usepackage[tmargin=1cm]{geometry}
\usepackage{lipsum}
\usepackage{tabulary,booktabs}
\begin{document}
\lipsum[1]

\begin{table}[b]
\begin{tabulary}{\linewidth}{CCC}
\toprule
\textbf{Original Pair }&\textbf{ Mapped  Pair}&
\textbf{Favourable / Alternative}\\
\midrule
a,a & e,g & Favourable \\
a,b & e,c & Alternative\\
c,d & c,e   & Alternative \\ 
\bottomrule
\end{tabulary}
\end{table}

\begin{table*}
\centering
\begin{tabular}{ccc}
\toprule
\textbf{Original Pair }&\textbf{ Mapped  Pair}&
\textbf{Favourable/Alternative}\\
\midrule
a,a & e,g & Favourable \\
a,b & e,c & Alternative\\
c,d & c,e   & Alternative \\ 
\bottomrule
\end{tabular}
\end{table*}
\lipsum[2-50]

\end{document}
1
\documentclass{article}
\begin{document}
\begin{minipage}{0.4\textwidth}
\begin{tabular}{|p{1.5cm}|p{1.5cm}|p{2.5cm}|}
\hline
\textbf{Original Pair }&\textbf{Mapped  Pair}&\textbf{Favourable}\\
\hline
 a,a & e,g & Favourable \\
\hline
b,b & e,c & Favourable\\
\hline
c,c & g,e & Favourable  \\ 
\hline
d,d & h,f   & Favourable\\ 
\hline
a,c & a,c & Favourable\\
\hline
c,a & c,a  & Favourable\\ 
\hline
b,d & b,d & Favourable  \\
\hline
d,b & d,b & Favourable   \\ 
\hline
\end{tabular}
\end{minipage}
\hspace{2cm}
\begin{minipage}{0.4\textwidth}
\begin{tabular}{|p{1.5cm}|p{1.5cm}|p{2.5cm}|}
\hline
\textbf{Original Pair }&\textbf{Mapped  Pair}&\textbf{Alternative}\\
\hline
a,b & e,c & Alternative\\
\hline
a,d & a,g & Alternative  \\
\hline    
b,a & e,g & Alternative \\
\hline
b,c & a,c & Alternative\\
\hline
c,b & g,a  & Alternative \\ 
\hline
c,d & c,e   & Alternative \\ 
\hline
d,a & d,f  & Alternative  \\ 
\hline
d,c & h,b  & Alternative \\ 
\hline
\end{tabular}
\end{minipage}
\end{document}

mini

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.