How can I make this table fit inside left and right margin?
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{array}
\textwidth 15cm
\textheight 22cm
\parindent 10pt
\oddsidemargin 0.85cm
\evensidemargin 0.37cm
\begin{document}
\begin{table}
\noindent
\begin{tabular}{|c|c|c|c|c|c|}
\hline
& base & \multicolumn{1}{l|}{exp-resLayer2} & \multicolumn{1}{l|}{exp-resLayer10} & \multicolumn{1}{l|}{exp-resLayer2-lr} & \multicolumn{1}{l|}{exp-resLayer10-lr} \\ \hline
numIters & 20 & 20 & 20 & 20 & 20 \\ \hline
numEps & 20 & 20 & 20 & 20 & 20 \\ \hline
tempThreshold & 400 & 400 & 400 & 400 & 400 \\ \hline
updateThreshold & 0.54 & 0.54 & 0.54 & 0.54 & 0.54 \\ \hline
numMCTSSims & 50 & 50 & 50 & 50 & 50 \\ \hline
arenaCompare & 20 & 20 & 20 & 20 & 20 \\ \hline
cpuct & 1 & 1 & 1 & 1 & 1 \\ \hline
numItersForTrainExamplesHistory & 20 & 20 & 20 & 20 & 20 \\ \hline
& & & & & \\ \hline
lr & 0.01 & 0.01 & 0.001 & 0.01 & 0.001 \\ \hline
epochs & 10 & 10 & 10 & 10 & 10 \\ \hline
batch\_size & 32 & 32 & 32 & 32 & 32 \\ \hline
residual\_block\_num & 5 & 2 & 10 & 2 & 10 \\ \hline
image\_stack\_layers & 9 & 9 & 9 & 9 & 9 \\ \hline
\end{tabular}
\end{table}
\end{document}
May someone help me please? Using \makebox
is not a good output!
EDIT:
\textwidth 15cm
Best Answer
Moving the duplicate information of
exp-resLayer
out of each head and above them in a\multicolumn
does wonders to your table width:EDIT: if it should be more clear that each of the columns should be something like
exp-resLayer<i>
then one could change that to:An imho prettier version without all those vertical rules and less horizontal ones: