# Adjust table to fit within the page

I am generating a table but I dont know why it's getting out of the page!

    [\begin{tabular}{|*{3}{l|}*{5}{c|}}
\hline
\textbf{Participant}  & \textbf{Systèmes}  & \textbf{Inventaires de sens}  & \textbf{Anglais}  & \textbf{Français}  & \textbf{Allemand}  & \textbf{Italien}  & \textbf{Espagnol}\\
\hline
\multirow{2}{*}{\textbf{UMCC}}  & \multirow{2}{*}{$\mathrm{DLSI\_(WSD)-1}$}  & BabelNet  & 8  & 10 & 12 & 14 & 16\\
\cline{3-8}
&   & Wikipédia  & 12 & 15 & 18 & 21 & 24\\
\cline{3-8}
&   & WordNet & 16 & 20 & 24 & 28 & 32\\
\hline
\multirow{2}{*}{\textbf{UMCC}}  & \multirow{2}{*}{$\mathrm{DLSI\_ (WSD)-2}$}  & BabelNet  & 8  & 10 & 12 & 14 & 16\\
\cline{3-8}
&   & Wikipédia  & 12 & 15 & 18 & 21 & 24\\
\cline{3-8}
&   & WordNet & 16 & 20 & 24 & 28 & 32\\
\hline
\multirow{2}{*}{\textbf{UMCC}}  & \multirow{2}{*}{$\mathrm{DLSI\_ (WSD)-3}$}  & BabelNet  & 8  & 10 & 12 & 14 & 16\\
\cline{3-8}
&   & Wikipédia  & 12 & 15 & 18 & 21 & 24\\
\cline{3-8}
&   & WordNet & 16 & 20 & 24 & 28 & 32\\
\hline
\textbf{DAEBAK!}  & PD & BabelNet & 36 & 45 & 54 & 63 & 72\\
\hline
\textbf{GETALP}  & BN-1 & BabelNet & 36 & 45 & 54 & 63 & 72\\
\hline
\textbf{GETALP}  & BN-2 & BabelNet & 36 & 45 & 54 & 63 & 72\\
\hline
\textbf{GETALP}  & WN-1 & WordNet & 36 & 45 & 54 & 63 & 72\\
\hline
\multicolumn{3}{|l|}{\textbf{MFS}} & 36 & 45 & 54 & 63 & 72\\
\hline
\end{tabular}][2]


• you are (mis)using tabularx: you need longtable for multi-page tables. If you do need tabularx for single-page tables, they must include an X column. (it is not an error not to have X but tabularx can do nothing for such a table, you could use teh standard tabular in that case) – David Carlisle Mar 2 '15 at 12:10
• tabular or tabularX dont change anything .. it did not get me what i want! – bttX Mar 2 '15 at 12:22
• No as I say, what you want is longtable. tabular and tabularx never break over a page. – David Carlisle Mar 2 '15 at 12:24
• so, i change tabular by longtable ? – bttX Mar 2 '15 at 12:31
• So you should read the documentation on ctan.org/pkg/longtable and you will learn how to do that. – LaRiFaRi Mar 2 '15 at 12:56

Your table is too wide for the page. You will have to rotate it or reformat it completely. You could also try to reduce each column with p{...cm} columns or by reducing the font size, but this will not help for good readability.

% arara: pdflatex

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{rotating}
\usepackage{caption}
\usepackage{siunitx}

\begin{document}
\noindent
\begin{sidewaystable}
\centering
\begin{tabular}{*{3}{l}*{5}{S[table-format=2.0]}}
\toprule
\textbf{Participant}  & \textbf{Systèmes}  & \textbf{Inventaires de sens}  & \textbf{Anglais}  & \textbf{Français}  & \textbf{Allemand}  & \textbf{Italien}  & \textbf{Espagnol}\\
\midrule
\multirow{3}{*}{\textbf{UMCC}}  & \multirow{3}{*}{$\mathrm{DLSI\_(WSD)-1}$}  & BabelNet  & 8  & 10 & 12 & 14 & 16\\
&   & Wikipédia  & 12 & 15 & 18 & 21 & 24\\
&   & WordNet & 16 & 20 & 24 & 28 & 32\\
\multirow{3}{*}{\textbf{UMCC}}  & \multirow{3}{*}{$\mathrm{DLSI\_ (WSD)-2}$}  & BabelNet  & 8  & 10 & 12 & 14 & 16\\
&   & Wikipédia  & 12 & 15 & 18 & 21 & 24\\
&   & WordNet & 16 & 20 & 24 & 28 & 32\\
\multirow{3}{*}{\textbf{UMCC}}  & \multirow{3}{*}{$\mathrm{DLSI\_ (WSD)-3}$}  & BabelNet  & 8  & 10 & 12 & 14 & 16\\
&   & Wikipédia  & 12 & 15 & 18 & 21 & 24\\
&   & WordNet & 16 & 20 & 24 & 28 & 32\\
\textbf{DAEBAK!}  & PD & BabelNet & 36 & 45 & 54 & 63 & 72\\
\textbf{GETALP}  & BN-1 & BabelNet & 36 & 45 & 54 & 63 & 72\\
\textbf{GETALP}  & BN-2 & BabelNet & 36 & 45 & 54 & 63 & 72\\
\textbf{GETALP}  & WN-1 & WordNet & 36 & 45 & 54 & 63 & 72\\
\textbf{MFS} & &  & 36 & 45 & 54 & 63 & 72\\
\bottomrule
\end{tabular}
\end{sidewaystable}
\end{document}


• but i dont what it to be like this! is there anything else to do to make it straight – bttX Mar 2 '15 at 17:27
• @batitamohamedali I named four possible modifications. You will have to decide. I can't make your page bigger. Sorry, but you will find everything somewhere around here. If you can't get your desired approach working, you could ask a clearer question on this very problem. – LaRiFaRi Mar 2 '15 at 22:06

If a table is too wide you just have to make it narrower. In this case the width was dominated by the headings so:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multirow}
\usepackage{booktabs}

\usepackage{caption}
\usepackage{siunitx}

\newcommand\hd[1]{\textbf{\begin{tabular}{@{}c@{}}#1\end{tabular}}}
\begin{document}

\centering

X\dotfill X

{\setlength\tabcolsep{5pt}
\begin{tabular}{*{3}{l}*{5}{S[table-format=2.0]}}
\toprule
\hd{Participant}  & \hd{Systèmes}  & \hd{Inventaires\\ de sens}  & \hd{GB}  & \hd{FR}  & \hd{DE}  & \hd{IT}  & \hd{ES}\\
\midrule
\multirow{3}{*}{\textbf{UMCC}}  & \multirow{3}{*}{$\mathrm{DLSI\_(WSD)-1}$}  & BabelNet  & 8  & 10 & 12 & 14 & 16\\
&   & Wikipédia  & 12 & 15 & 18 & 21 & 24\\
&   & WordNet & 16 & 20 & 24 & 28 & 32\\
\multirow{3}{*}{\textbf{UMCC}}  & \multirow{3}{*}{$\mathrm{DLSI\_ (WSD)-2}$}  & BabelNet  & 8  & 10 & 12 & 14 & 16\\
&   & Wikipédia  & 12 & 15 & 18 & 21 & 24\\
&   & WordNet & 16 & 20 & 24 & 28 & 32\\
\multirow{3}{*}{\textbf{UMCC}}  & \multirow{3}{*}{$\mathrm{DLSI\_ (WSD)-3}$}  & BabelNet  & 8  & 10 & 12 & 14 & 16\\
&   & Wikipédia  & 12 & 15 & 18 & 21 & 24\\
&   & WordNet & 16 & 20 & 24 & 28 & 32\\
\textbf{DAEBAK!}  & PD & BabelNet & 36 & 45 & 54 & 63 & 72\\
\textbf{GETALP}  & BN-1 & BabelNet & 36 & 45 & 54 & 63 & 72\\
\textbf{GETALP}  & BN-2 & BabelNet & 36 & 45 & 54 & 63 & 72\\

• I just used \resizebox and my table fits horizontally, but it's still a bit too large vertically (I'm talking about fitting a Beamer slide). What is the simplest solution for this? Most of related questions on this site deal with former, not the latter (unless I haven't found them). Thank you! – Aleksandr Blekh Mar 30 '15 at 14:22
• @AleksandrBlekh don't use \resizebox (otherwise you'll just scale the table back up after making it small) if you put it inside the tabular it will just affect one cell, if you put it inside the {table} it will just affect that table, if you put it inside {frame} it will just affect that frame, etc. It has the same scope as any font change like \bfseries – David Carlisle Mar 30 '15 at 14:45