[Tex/LaTex] making a table fit on a page by moving it left

floatshorizontal alignmentmargins

I have a table where the last columns fall off the page. Instead of making the text smaller I would like the table to not adhere to the margin of where it begins. I would like to move it to the left. I am using flushleft, which is not working. Here is the code:

\begin{figure}
\begin{flushleft}
\begin{tabular}{l|l|l|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\multicolumn{21}{l}{a)text}\\ \hline
    & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10& 11& 12& 13& 14& 15& 16& 17& 18& 19& 20\\ \hline
day1&9.2&8.6&8.1&6.3&7.7&7.3&8.0&8.4&5.9&6.8&7.3&7.6&9.0&7.4&6.6&7.0& 5.3&7.0&8.0&5.2\\
day2&6.7&6.9&0&7.0&0&8.1&9.0&6.1&0&6.9&0&7.3&7.8&5.3&0&8.9&0&8.4&8.4&7.5\\
day3&0&5.2&0&0&7.5&0&0&8.2&0&0&5.4&0&0&8.3&0&0&7.7&0&0&7.3
\end{tabular}
\end{flushleft}
\caption{\label{fig:text}text experiment}
\end{figure}

What can be modified? What possible solutions exist?

Best Answer

You could use adjustwidth from the changepage package which allows you to widen or shorten the page width from the left or the right.

I loaded the geometry package with showframe=true just so that you an see where the page boundaries lie.

screenshot

\documentclass{article}
\usepackage[showframe=true]{geometry}
\usepackage{changepage}

\begin{document}

\begin{figure}
 \begin{adjustwidth}{-2cm}{}
\begin{tabular}{l|l|l|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\multicolumn{21}{l}{a)text}\\ \hline
& 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10& 11& 12& 13& 14& 15& 16& 17& 18& 19& 20\\ \hline
day1&9.2&8.6&8.1&6.3&7.7&7.3&8.0&8.4&5.9&6.8&7.3&7.6&9.0&7.4 &6.6&7.0&5.3&7.0&8.0&5.2\\
day2&6.7&6.9&0&7.0&0&8.1&9.0&6.1&0&6.9&0&7.3&7.8&5.3&0&8.9&0&8.4&8.4&7.5\\
day3&0&5.2&0&0&7.5&0&0&8.2&0&0&5.4&0&0&8.3&0&0&7.7&0&0&7.3
\end{tabular}
\caption{\label{fig:text}text experiment}
 \end{adjustwidth}
\end{figure}

\end{document}
Related Question