0

I'm unable to keep my table on the page, not sure how to fix it. Help appreciated.

Here is my table:

\begin{landscape}

\begin{tabular}{|c|c|c|c|c|c|c|}

\multicolumn{7}{c}{\textbf{Data from testing}}\\
\hline
\multicolumn{2}{|c|}{Population information}&\multicolumn{3}{c|}{Anaerobic power data}&\multicolumn{2}{c|}{Anaerobic endurance data}\\
\hline
\multirow{2}{*}{Participant number, age, and weight}&\multirow{2}{*}{Status}&\multicolumn{2}{c|}{Power clean}&\multirow{2}{*}{Broad jump (m)}&\multirow{2}{*}{500m row (minutes:seconds)}&Air bike 50 cal (seconds)\\
\cline{3-4}
&&kg&\%bw&&&\\
\hline
\multicolumn{7}{|c|}{Trained sprinter}\\
\hline
1. Male, 24, 72 kg.&National level sprinter - 100m&130&1.8&2.1&1:34&7\\
\hline
2. Male, 22, 75 kg.&National level sprinter - 200m&105&1.4&2.2&1:32&7\\
\hline
3. Male, 25, 78 kg.&National level sprinter - 400m&90&1.2&1.9&1:2&7\\
\hline
4. Male, 24, 74 kg.&Recreational sprinter&85&1.1&1.7&1:38&7\\
\hline
5. Male, 23, 68 kg.&Recreational sprinter&70&1.0&1.9&1:41&7\\
\hline
\multicolumn{7}{|c|}{Untrained sprinter}\\
\hline
6. Female, 27, 47 kg.&Recreational Olympic weightlifter&50&1.1&1.6&6&7\\
\hline
7. Male, 25, 82 kg.&Recreational jogging and gym&55&0.67&1.7&6&7\\
\hline
8. Male, 32, 77 kg.&Daily walks&35&0.45&1.3&6&7\\
\hline
9. Male, 26, 86 kg.&Inactive&30&0.35&1.2&6&7\\
\hline
10. Female, 33, 74 kg.&Inactive&20 (empty bar)&0.27&0.7&6&7\\
\hline
\hline
\multicolumn{7}{|c|}{Statistical values - trained}\\
\hline
mean&2&3&4&5&6&7\\
\hline
standard deviation&2&3&4&5&6&7\\
\hline

\end{tabular}
1

2 Answers 2

1

You can use p-type columns (or X-type with tabularx). Or just split long cell contents on multiple lines. In addition, I suggest to use booktabs to prettify your tabular; use caption to add the title.

\documentclass{report}
\usepackage{multirow}
\usepackage{pdflscape}
\usepackage{booktabs}
\begin{document}
    
    \begin{landscape}
      \begin{tabular}{|c|c|c|c|c|c|c|}
      
      \multicolumn{7}{c}{\textbf{Data from testing}}\\
      \hline
      \multicolumn{2}{|c|}{Population information}&\multicolumn{3}{c|}{Anaerobic power data}&\multicolumn{2}{c|}{Anaerobic endurance data}\\
      \hline
%      \multirow{2}{*}{Participant number, age, and weight}&\multirow{2}{*}{Status}&\multicolumn{2}{c|}{Power clean}&\multirow{2}{*}{Broad jump (m)}&\multicolumn{1}{m{2cm}|}{{500m row\par(minutes:seconds)}}&Air bike 50 cal (seconds)\\
      Participant number&\multirow{2}{*}{Status}&\multicolumn{2}{c|}{Power clean}&Broad jump&500m row&Air bike 50 cal \\
      \cline{3-4}
      age, and weight&&kg&\%bw&(m)&(minutes:seconds)&(seconds)\\
      \hline
      \multicolumn{7}{|c|}{Trained sprinter}\\
      \hline
      1. Male, 24, 72 kg.&National level sprinter - 100m&130&1.8&2.1&1:34&7\\
      \hline
      2. Male, 22, 75 kg.&National level sprinter - 200m&105&1.4&2.2&1:32&7\\
      \hline
      3. Male, 25, 78 kg.&National level sprinter - 400m&90&1.2&1.9&1:2&7\\
      \hline
      4. Male, 24, 74 kg.&Recreational sprinter&85&1.1&1.7&1:38&7\\
      \hline
      5. Male, 23, 68 kg.&Recreational sprinter&70&1.0&1.9&1:41&7\\
      \hline
      \multicolumn{7}{|c|}{Untrained sprinter}\\
      \hline
      6. Female, 27, 47 kg.&Recreational Olympic weightlifter&50&1.1&1.6&6&7\\
      \hline
      7. Male, 25, 82 kg.&Recreational jogging and gym&55&0.67&1.7&6&7\\
      \hline
      8. Male, 32, 77 kg.&Daily walks&35&0.45&1.3&6&7\\
      \hline
      9. Male, 26, 86 kg.&Inactive&30&0.35&1.2&6&7\\
      \hline
      10. Female, 33, 74 kg.&Inactive&20 (empty bar)&0.27&0.7&6&7\\
      \hline
      \hline
      \multicolumn{7}{|c|}{Statistical values - trained}\\
      \hline
      mean&2&3&4&5&6&7\\
      \hline
      standard deviation&2&3&4&5&6&7\\
      \hline
      
    \end{tabular}
  \end{landscape}
  
  \begin{landscape}
  \begin{table}
    \caption{Data from testing}
    \begin{tabular}{@{}*{7}{c}@{}}
      \toprule
      \multicolumn{2}{c}{Population information} & \multicolumn{3}{c}{Anaerobic power data} & \multicolumn{2}{c}{Anaerobic endurance data}\\
      Participant number&\multirow{2}{*}{Status}&\multicolumn{2}{c}{Power clean}&Broad jump&500m row&Air bike 50 cal \\
%      \cline{3-4}
      age, and weight&&kg&\%bw&(m)&(minutes:seconds)&(seconds)\\
      \midrule
      \multicolumn{7}{c}{Trained sprinter}\\
      1. Male, 24, 72 kg.&National level sprinter - 100m&130&1.8&2.1&1:34&7\\
      2. Male, 22, 75 kg.&National level sprinter - 200m&105&1.4&2.2&1:32&7\\
      3. Male, 25, 78 kg.&National level sprinter - 400m&90&1.2&1.9&1:2&7\\
      4. Male, 24, 74 kg.&Recreational sprinter&85&1.1&1.7&1:38&7\\
      5. Male, 23, 68 kg.&Recreational sprinter&70&1.0&1.9&1:41&7\\
      \midrule
      \multicolumn{7}{c}{Untrained sprinter}\\
      6. Female, 27, 47 kg.&Recreational Olympic weightlifter&50&1.1&1.6&6&7\\
      7. Male, 25, 82 kg.&Recreational jogging and gym&55&0.67&1.7&6&7\\
      8. Male, 32, 77 kg.&Daily walks&35&0.45&1.3&6&7\\
      9. Male, 26, 86 kg.&Inactive&30&0.35&1.2&6&7\\
      10. Female, 33, 74 kg.&Inactive&20 (empty bar)&0.27&0.7&6&7\\
      \midrule
      \multicolumn{7}{c}{Statistical values - trained}\\
      mean&2&3&4&5&6&7\\
      standard deviation&2&3&4&5&6&7\\
      \bottomrule
      
  \end{tabular}
  \end{table}
    \end{landscape}
  
\end{document}

enter image description here

2
  • Maybe you can have a look at the spreadtab package to play with some spreadsheet functionalities.
    – NBur
    May 9, 2022 at 9:36
  • Thanks heaps, that's exactly what I wanted!
    – Gian Carp
    May 9, 2022 at 9:39
1

I propose a solution with the makecell & geometry packages (the latter to have more decent margins, if you don't use marginal notes). I added some improvements as regards the vertical spacing in table, with the cellspace package:

    \documentclass{article}
    \usepackage{geometry}
    \usepackage{multirow, array}
    \usepackage{lscape}
    \usepackage{makecell}
    \usepackage{cellspace}
    \setlength{\cellspacetoplimit}{4pt}
    \setlength{\cellspacebottomlimit}{4pt}

    \begin{document}

    \begin{landscape}
    \centering
    \begin{tabular}{|*{7}{Sc|}}
    \multicolumn{7}{Sc}{\textbf{Data from testing}}\\
    \hline
    \multicolumn{2}{|Sc|}{Population information}&\multicolumn{3}{Sc|}{Anaerobic power data}&\multicolumn{2}{Sc|}{Anaerobic endurance data}\\
    \hline
    \multirowcell{2}{Participant number,\\ age and weight}&\multirow{2}{*}{Status}&\multicolumn{2}{c|}{Power clean}&\multirowcell{2}{Broad jump \\ (m)}&\multirowcell{2}{500m row\\ (minutes:seconds)}& \makecell{Air bike \\ 50 cal \\(seconds)}\\
    \cline{3-4}
    &&kg&\%bw&&&\\
    \hline
    \multicolumn{7}{|Sc|}{Trained sprinter}\\
    \hline
    1. Male, 24, 72 kg.& \makecell{National level sprinter\\– 100m} &130&1.8&2.1&1:34&7\\
    \hline
    2. Male, 22, 75 kg.& \makecell{National level sprinter\\– 200m}&105&1.4&2.2&1:32&7\\
    \hline
    3. Male, 25, 78 kg.&\makecell{National level sprinter\\– 400m}&90&1.2&1.9&1:2&7\\
    \hline
    4. Male, 24, 74 kg.& Recreational sprinter &85&1.1&1.7&1:38&7\\
    \hline
    5. Male, 23, 68 kg.& Recreational sprinter &70&1.0&1.9&1:41&7\\
    \hline
    \multicolumn{7}{|Sc|}{Untrained sprinter}\\
    \hline
    6. Female, 27, 47 kg.& \makecell{Recreational\\ Olympic weightlifter}&50&1.1&1.6&6&7\\
    \hline
    7. Male, 25, 82 kg.& \makecell{Recreational\\ jogging and gym}&55&0.67&1.7&6&7\\
    \hline
    8. Male, 32, 77 kg.& Daily walks &35&0.45&1.3&6&7\\
    \hline
    9. Male, 26, 86 kg.& Inactive &30&0.35&1.2&6&7\\
    \hline
    10. Female, 33, 74 kg.& Inactive & 20 (empty bar)&0.27&0.7&6&7\\
    \hline
    \hline
    \multicolumn{7}{|Sc|}{Statistical values - trained}\\
    \hline
    mean&2&3&4&5&6&7\\
    \hline
    standard deviation&2&3&4&5&6&7\\
    \hline
    \end{tabular}
    \end{landscape}

    \end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .