[Tex/LaTex] scaling a table to fit an entire page

scalingtables

I used Excel2Latex to pump out some tables from my excel file. All works fine but heres the output picture:

table picture

I want the table to be streched accross the entire page. Is this possible and if so how do I do it. Here is the code I am using:

\documentclass{article}
\usepackage{bigstrut}

\begin{document}

  % Table generated by Excel2LaTeX from sheet 'Sheet1'
\begin{table}[htbp]
\centering
\caption{Table shows the commulative oxygen levels at 2 minute time intervals. The displacement is measured in \textbf{cm}}
\begin{tabular}{|r|r|r|r|r|r|r|r|r|r|}
\cline{2-10}    
\multicolumn{1}{r|}{} & \multicolumn{9}{c|}{\textbf{Time of reading (in min)}}   \\
\cline{2-10}    
\multicolumn{1}{r|}{} & \multicolumn{1}{r}{\textbf{0}} & \multicolumn{1}{r}{\textbf{2}} & \multicolumn{1}{r}{\textbf{4}} & \multicolumn{1}{r}{\textbf{6}} & \multicolumn{1}{r}{\textbf{8}} & \multicolumn{1}{r}{\textbf{10}} & \multicolumn{1}{r}{\textbf{12}} & \multicolumn{1}{r}{\textbf{14}} & \textbf{16} \bigstrut\\
    \hline
    \hline
    \textbf{Treatment 1} & 0     & 0     & 0.5   & 0.7   & 0.9   & 0.9   & 1     & 1.2   & 1.8 \bigstrut\\
    \hline
    \textbf{Treatment 2} & 0     & 0     & 0     & 0.1   & 0.1   & 0.1   & 0.1   & 0.2   & 0.5 \bigstrut\\
    \hline
    \textbf{Treatment 3} & 0     & 0     & 0     & 0     & 0     & 0     & 0     & 0     & 0 \bigstrut\\
    \hline
    \end{tabular}%
  \label{tab:addlabel}%
\end{table}%
\end{document}

Best Answer

To declare some predefined width for your table, you can use the tabular* environment or, even better, the tabularx environment from the tabularx package. I would also suggest you to consider some changes to the table layout: 1) Don't use vertical rules. 2) Use the features provided by the booktabs package. Here's your table with some modifications:

\documentclass{book}
\usepackage{booktabs}
\usepackage{tabularx}

\begin{document}

\begin{table}
  \centering
  \caption{Table shows the commulative oxygen levels at 2 minute time 
       intervals. The displacement is measured in \textbf{cm}}
  \begin{tabularx}{\textwidth}{@{}>{\bfseries}c*{9}{X}@{}}
  \toprule
  Treatment & \multicolumn{9}{c@{}}{\textbf{Time of reading (in min)}} \\
  \cmidrule(l){2-10}    
  & \textbf{0} & \textbf{2} & \textbf{4} & \textbf{6} & \textbf{8} 
  & \textbf{10} & \textbf{12} & \textbf{14} & \textbf{16} \\
  \cmidrule(r){1-1}\cmidrule(l){2-10}
  1 & 0     & 0     & 0.5   & 0.7   & 0.9   & 0.9   & 1     & 1.2   & 1.8 \\
  2 & 0     & 0     & 0     & 0.1   & 0.1   & 0.1   & 0.1   & 0.2   & 0.5 \\
  3 & 0     & 0     & 0     & 0     & 0     & 0     & 0     & 0     & 0 \\
  \bottomrule
  \end{tabularx}%
  \label{tab:addlabel}%
\end{table}%

\end{document}

enter image description here

Related Question