I have the exact same problem presented in: Creating a table fitting one column of a two column style page. However, the solution there presented does not work for me. The table don't even appear.
So, I want to put a table in just one of the columns, exactly behind the text. I have the following code:
\documentclass[twoside]{article}
\usepackage[hmarginratio=1:1,top=32mm,columnsep=25pt]{geometry}
\usepackage{multicol}
\begin{document}
\begin{multicols}{2}
Among the risk factors (...). Table \ref{T1} lists some of them.
\begin{table}[b]
\centering
\caption{My caption}
\label{T1}
\resizebox{\columnwidth}{!}{%
\begin{tabular}[b]{l}
\hline
High LDL cholesterol \\
Cigarette smoking\\
Hypertension (BP$\geq 140/90 mmH$g or on antihypertensive medication)\\
Low HDL cholesterol ($<1.0 mmol/L$) \\
Diabetes mellitus \\
Family history of premature CHD \\
Age (men$\geq 45$ years; women$\geq 55$ years)\\
Lifestyle risk factors\\
Obesity (BMI$\geq 30Kg/m^{2}$)\\
Physical inactivity \\
Atherogenic diet\\
Emerging risk factors \\
Lipoprotein (a) \\
Prothrombotic factors \\
Proinflammatory factors \\
Impaired fasting glucose \\
Subclinical atherosclerosis \\
\hline
\end{tabular}
}
\end{table}
\end{multicols}
\end{document}
I have also tried this:
\begin{table}[b]
\centering
\caption{My caption}
\label{T1}
\begin{tabular}[b]{l}
\hline
High LDL cholesterol \\
Cigarette smoking\\
Hypertension (BP$\geq 140/90 mmH$g or on antihypertensive medication)\\
Low HDL cholesterol ($<1.0 mmol/L$) \\
Diabetes mellitus \\
Family history of premature CHD \\
Age (men$\geq 45$ years; women$\geq 55$ years)\\
Lifestyle risk factors\\
Obesity (BMI$\geq 30Kg/m^{2}$)\\
Physical inactivity \\
Atherogenic diet\\
Emerging risk factors \\
Lipoprotein (a) \\
Prothrombotic factors \\
Proinflammatory factors \\
Impaired fasting glucose \\
Subclinical atherosclerosis \\
\hline
\end{tabular}
\end{table}
What am I doing wrong?
Best Answer
As stated in the comments, you can not use a normal float in the
multicols
-environment. You have to use their starred versions, in your casetable*
. You can of course put thetable
-environment outside themulticols
-environment. Please check the multicol manual.In either case, the table won't be put in one of the columns, hence it makes no sense, to use the
\resizebox
-command, to scale it to width. I removed it in my solution. If you insist on it, you'll have to load thegraphics
- orgraphicx
-package, too.This will work from within
multicols
:I personally prefer this approach: