I am creating a two-column document using latex. I use the option \columnwidth
to autofit a table to the column width, as shown in the following figure. The second column Value
is too wide. How do I set equal width for two columns?
Here is my source code.
\begin{table}
\centering
\caption{Simulation parameters}
\begin{tabular}{l|l}
\hline
Key & Value \\
\hline
simulation duration & 12 hours \\
update interval & 1s \\
time-to-live & 12 hours \\
buffer size & infinite \\
message interval & 20s \\
\hline
\end{tabular}
\end{table}
\begin{table}
\centering
\caption{Simulation parameters}
\begin{tabularx}{\columnwidth}{l|l}
\hline
Key & Value \\
\hline
simulation duration & 12 hours \\
update interval & 1s \\
time-to-live & 12 hours \\
buffer size & infinite \\
message interval & 20s \\
\hline
\end{tabularx}
\label{table: simulation parameters}
\end{table}
p{'width'}
instead ofl
as the secondtabular
parameter to do this. If not, could you describe what you mean with "the second column is to wide"? I'm not exactly sure what's the problem in your first table.