[Tex/LaTex] Auto Fit tables to Columns Width without changing the font size

fittablestwo-column

I am really tired of searching. It is very simple issue in MS-Word but how I can't run it in Latex.
I have a two column document. If a table has a enough width there is no problem, but if it was smaller than column width (Whether one or two column) I use {adjustbox}{width=1\textwidth} but it change the size of the font.
For example for the following code:

\section{RESULTS}\label{sec:res}One hundred patients enrolled in this study including 63 (63\%) men and 37 (37\%) women. Mean age of participants was 60 ± 5 years with minimum age of 44 years old and maximum age of 80 years old. Patients’ demographics are summarized in Table 1.\begin{table}[ht]\centering\caption{Patient Characteristics}\label{table1}\begin{adjustbox}{width=0.5\textwidth}\begin{tabular}{lc}\hlineCharacteristics                  & N = 100  \\\hlineAge (years)                      & 60 ± 5  \\Female                           & 37 (37) \\Diabetes mellitus                & 36 (36) \\Hypertension                     & 50 (50) \\hyperlipidemia                   & 50 (50) \\Smoker                           & 33 (33) \\Left ventricular function        &           \\\hspace{3mm}EF \textgreater= 45\%            & 84 (84) \\\hspace{3mm}30\% \textless EF \textless 45\% & 16 (16) \\\hspace{3mm}EF \textless= 30\%               & 0 (0) \\\hline\end{tabular}\end{adjustbox}\end{table}The minimum and maximum of measured peak SBP before CR, was 90 and 155 mmHg respectively. The mean of peak SBP was 121.95 ± 14.21 mmHg. The minimum and maximum of measured SBP after CR, was 100 mmHg and 150 mmHg respectively with mean of 121.55 ± 11.84 mmHg. Mean of SBP did not significantly change after CR (P = 0.76). The minimum of measured DBP before CR was 60 mmHg and the maximum was 90 mmHg with mean of 78.55 ± 7.18 mmHg. The minimum of measured DBP after CR was 60 mmHg and maximum was 90 mmHg. The mean DBP was 77.35 ± 7.08 mmHg. Mean of DBP was not significantly different before and after CR (P = 0.12) Minimum of PPI before CR was 0.33 and maximum of it was 0.83 with mean of 0.35 ± 0.046. After CR, minimum of PPI was 0.27 and maximum was 0.53 with mean of 0.36 ± 0.048. Mean of PPI was not significantly different before and after CR (P = 0.12).\\

Then I have:

Why the size of the table is diffrent

I used {width=0.5\textwidth} and if I changed the 0.5 to 1 the table turn even bigger.
Could anybody tell me that how can I only fit the tables to the columns width?

Thank you in advance for your supports.

Best Answer

By using \adjustbox, you basically guarantee some kind of major font size change. Use a tabular* environment instead.

Oh, and for well-spaced horizontal lines, do load the booktabs package and its macros \toprule, \midrule, and \bottomrule.

enter image description here

\documentclass[twocolumn]{article}
\usepackage{booktabs} % for \toprule, \midrule, and \bottomrule macros
\begin{document}

\section{Results}\label{sec:res}

One hundred patients enrolled in this study including 63 (63\%) men and 37 
(37\%) women. Mean age of participants was $60 \pm 5$ years with minimum 
age of 44 years old and maximum age of 80 years old. Patients' demographics 
are summarized in Table~\ref{table1}.

\begin{table}[ht]
\caption{Patient Characteristics}\label{table1}
\begin{tabular*}{\columnwidth}{@{\extracolsep{\fill}}lr@{}}
\toprule
Characteristics                  & $N = 100$  \\
\midrule
Age (years)                      & $60 \pm 5$  \\
Female                           & 37 (37) \\
Diabetes mellitus                & 36 (36) \\
Hypertension                     & 50 (50) \\
hyperlipidemia                   & 50 (50) \\
Smoker                           & 33 (33) \\
Left ventricular function        &  \\
\hspace{3mm}EF $\ge$ 45\%        & 84 (84) \\
\hspace{3mm}30\% $<$ EF $<$ 45\% & 16 (16) \\
\hspace{3mm}EF $\le$ 30\%        & 0 (0) \\
\bottomrule
\end{tabular*}
\end{table}

The minimum and maximum of measured peak SBP before CR, was 90 and 
155 mmHg respectively. The mean of peak SBP was $121.95 \pm 14.21$ 
mmHg. The minimum and maximum of measured SBP after CR, was 100 mmHg 
and 150 mmHg respectively with mean of $121.55 \pm 11.84$ mmHg. Mean 
of SBP did not significantly change after CR ($P = 0.76$). The 
minimum of measured DBP before CR was 60 mmHg and the maximum was 
90 mmHg with mean of $78.55 \pm 7.18$ mmHg. The minimum of measured DBP 
after CR was 60 mmHg and maximum was 90 mmHg. The mean DBP was $77.35 
\pm 7.08$ mmHg. Mean of DBP was not significantly different before and 
after CR (P = 0.12) Minimum of PPI before CR was 0.33 and maximum of it 
was 0.83 with mean of $0.35 \pm 0.046$. After CR, minimum of PPI was 
0.27 and maximum was 0.53 with mean of $0.36 \pm 0.048$. Mean of PPI 
was not significantly different before and after CR ($P = 0.12$).

\end{document}