1

I'm writing a two-column paper in latex and I'm using \resizebox to adjust table size to paper column width as shown code portion below. However, if table content is not much I face the problem that the table text size is slightly larger than paragraph text size. Is there a way to set a limit on maximum text size scaling or to modify table fontsize + while still using \resizebox?

\begin{table}[ht]
\centering
\small  
\caption{Results}
\label{tb1}
\resizebox{\columnwidth}{!}{\begin{tabular}{cccccc}
        \cline{1-6}
        Sensor& P1 &P2&P3&P4&P5\\ \cline{1-6}       
        Val1 &2  &2  &2 &2 &5  \\ \cline{1-6}           
        Val2 &13 &13 &15 &8 &50 \\ \cline{1-6}          
\end{tabular}}\end{table}

Thank you and regards,

Ayomi

3

Resizing tables is not the best way to cope with the problem, better is using tabular*.

\documentclass[twocolumn]{article}

\usepackage{lipsum} % for context

\begin{document}

\lipsum[1]

\begin{table}[ht]
\centering
\caption{Results}\label{tb1}
\begin{tabular*}{\columnwidth}{
  @{\extracolsep{\fill}\hspace{\tabcolsep}}
  cccccc
  @{\hspace{\tabcolsep}}
}
\hline
Sensor& P1 &P2&P3&P4&P5\\
\hline
Val1 &2  &2  &2 &2 &5  \\
\hline
Val2 &13 &13 &15 &8 &50 \\
\hline
\end{tabular*}
\end{table}

\lipsum[2-12]

\end{document}

enter image description here

With caption and booktabs you get a better result:

\documentclass[twocolumn]{article}
\usepackage{caption,booktabs}

\usepackage{lipsum} % for context

\begin{document}

\lipsum[1]

\begin{table}[ht]
\centering
\caption{Results}\label{tb1}
\begin{tabular*}{\columnwidth}{
  @{\extracolsep{\fill}\hspace{\tabcolsep}}
  cccccc
  @{\hspace{\tabcolsep}}
}
\toprule
Sensor& P1 &P2&P3&P4&P5\\
\midrule
Val1 &2  &2  &2 &2 &5  \\
Val2 &13 &13 &15 &8 &50 \\
\bottomrule
\end{tabular*}
\end{table}

\lipsum[2-12]

\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.