1

I want a table to fit in only column of a page. For that I'm using resizebox:

\begin{table}[!t]
\renewcommand{\arraystretch}{1.3}
\caption{Sample table}
\label{table_example}
\centering
\resizebox{\columnwidth}{!}{%
\begin{tabular}{|c|c|c|}
\hline
Sr & Hypothesis & Result \\
\hline\hline
1 & May indulgence difficulty ham can put especially. Bringing remember & Proved \\
\hline
2 & Manor we shall merit by chief wound no or would. Oh towards between & Proved \\
\hline
3 & Style never met and those among great. At no or september sportsmen & Level1 Proved, Level2 Not Proved \\
\hline
4 & Cottage out enabled was entered greatly prevent message. No procured unlocked an likewise. & Level1 Proved, Level2 Not Proved \\
\hline
\end{tabular}
}
\end{table}

This gives me following output:

enter image description here

The font size of the contents in the table becomes shrinked? How do I increase this font size?

Also I want to increase size of second column and reduce the size of third column after increasing font size. How do I do it?

1
3

your table is wider than page width. consequently your attempt to fit it in column width with \resizebox also reduce font size ... only reasonable solution is redesign table such, that the text in cells is broken onto more linens and for table use font size \small for better fitting text in cells:

enter image description here

\documentclass[twocolumn]{article}
\usepackage{ragged2e}
\usepackage{tabularx}
\newcolumntype{L}{>{\RaggedRight}X}
\usepackage{lipsum}

\begin{document}
\lipsum[1]
    \begin{table}[htb]
\renewcommand{\arraystretch}{1.3}
\setlength\tabcolsep{4pt}
\caption{Sample table}
    \label{table_example}
\centering
\small
%\resizebox{\columnwidth}{!}{%
\begin{tabularx}{\linewidth}{|c|>{\hsize=1.2\hsize}L
                               |>{\hsize=0.8\hsize}L|}
\hline
Sr & Hypothesis & Result \\
\hline\hline
1 & May indulgence difficulty ham can put especially. Bringing remember & Proved \\
\hline
2 & Manor we shall merit by chief wound no or would. Oh towards between & Proved \\
\hline
3 & Style never met and those among great. At no or september sportsmen & Level1 Proved, Level2 Not Proved \\
\hline
4 & Cottage out enabled was entered greatly prevent message. No procured unlocked an likewise. & Level1 Proved, Level2 Not Proved \\
\hline
\end{tabularx}
%}
\end{table}
\lipsum
\end{document}

in above mwe is for table environment used tabularx for which you had prescribed table width. for columns is defined new column type L by help of macro \RaggedRight from ragged2e package. with this the multi line text formatting in cells is better than with centering (according to my taste). columns width ratio is also changed. if you like to have in table the same font size as it is in text, just remove \small., but hen the table be less nice (again to my taste).

1

To print a table that fits the columnwidth and includes text of the sane size as the surrounding text, you could use the tabu package as in the following MWE.

\documentclass[twocolumn]{scrreprt}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{tabu}

\begin{document}

\lipsum
\lipsum

\begin{table}[!t]
\renewcommand{\arraystretch}{1.3}
\caption{Sample table}
\label{table_example}
\centering
\tabulinesep=1.2mm
\begin{tabu} to \columnwidth{|c|X[c]|X[0.5c]|}
\hline
Sr & Hypothesis & Result \\
\hline\hline
1 & May indulgence difficulty ham can put especially. Bringing remember & Proved \\
\hline
2 & Manor we shall merit by chief wound no or would. Oh towards between & Proved \\
\hline
3 & Style never met and those among great. At no or september sportsmen & Level1 Proved, Level2 Not Proved \\
\hline
4 & Cottage out enabled was entered greatly prevent message. No procured unlocked an likewise. & Level1 Proved, Level2 Not Proved \\
\hline
\end{tabu}
\end{table}

\end{document}

enter image description here

3
  • with use of tabu you should be careful. package is buggy and not maintained.
    – Zarko
    Sep 17 '17 at 9:53
  • i took liberties and ad image of table produced by your mwe.
    – Zarko
    Sep 17 '17 at 9:55
  • @ Zarko: Thanks for adding the image and for the warning about the tabu package. Although I have not yet encountered any problems, I will consider switching to tabluarx as well.
    – leandriis
    Sep 17 '17 at 10:22

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.