2

I have a table written in tabu and wrapped in a table environment, but it is using 1.1\textwidth, and extends beyond the right margin of the page while anchored to the left margin. How do I make it centered so that it extends beyond the margin on both sides equally? Thanks.

This is my code:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}

\usepackage{geometry}
\geometry{a4paper}
\geometry{margin=2cm}

\usepackage[version=4]{mhchem}
\usepackage{float}
\usepackage{tabu}

\begin{document}

\begin{table}[H]
\begin{tabu} to 1.1\textwidth{| X[l] | X[l] | X[l] |}
\hline
\textbf{Apparatus/material} & \textbf{Quantity/amount/mass used} & \textbf{Uncertainty}\\
\hline 
Magnesium sulfate & 0.05, 0.10, 0.15, 0.20, 0.25 mol & $\pm$0.01g\\
\hline
Yeast, dried & 2.000g & $\pm$0.01g\\
\hline
Glucose (dextrose) & 3.000g & $\pm$0.01g\\
\hline
200cm\textsuperscript{3} beaker & 1 & NIL\\  
\hline
Test tube & 4 & NIL\\
\hline
250cm\textsuperscript{3} measuring cylinder & 1 & $\pm$1cm\textsuperscript{3}\\
\hline
10cm\textsuperscript{3} measuring cylinder & 1 & $\pm$0.1cm\textsuperscript{3}\\
\hline
Glass rod & 1 & NIL\\
\hline
Filter funnel & 1 & NIL\\
\hline
Vernier gas pressure sensor & 4 & $\pm$0.4mmHg\\
\hline
Vernier LabQuest datalogger & 1 & NIL\\
\hline
Excell BH-600 electronic balance & 1 & $\pm$0.01g\\
\hline
Apollo vortex mixer & 1 & NIL\\
\hline
Parafilm & NIL & NIL\\
\hline
\end{tabu}
\caption{Table of materials and apparatus}
\label{tab:ma}
\end{table}

This gives the table:

enter image description here

1 Answer 1

3

Like this?

enter image description here

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}

\usepackage{geometry}
\geometry{a4paper, margin=2cm}

%\usepackage[version=4]{mhchem}% <-- I had issues with this package, it gives error
%\usepackage{float} % not needed in this example
\usepackage{tabu}

\usepackage[strict]{changepage}% <-- added

\usepackage{showframe}% only for this example

\begin{document}
    \begin{table}%[H]
\begin{adjustwidth}{-0.05\linewidth}{-0.05\linewidth}
\begin{tabu} to 1.1\textwidth{| X[l] | X[l] | X[l] |}
\hline
\textbf{Apparatus/material} & \textbf{Quantity/amount/mass used} & \textbf{Uncertainty}\\
\hline
Magnesium sulfate & 0.05, 0.10, 0.15, 0.20, 0.25 mol & $\pm$0.01g\\
\hline
Yeast, dried & 2.000g & $\pm$0.01g\\
\hline
Glucose (dextrose) & 3.000g & $\pm$0.01g\\
\hline
200cm\textsuperscript{3} beaker & 1 & NIL\\
\hline
Test tube & 4 & NIL\\
\hline
250cm\textsuperscript{3} measuring cylinder & 1 & $\pm$1cm\textsuperscript{3}\\
\hline
10cm\textsuperscript{3} measuring cylinder & 1 & $\pm$0.1cm\textsuperscript{3}\\
\hline
Glass rod & 1 & NIL\\
\hline
Filter funnel & 1 & NIL\\
\hline
Vernier gas pressure sensor & 4 & $\pm$0.4mmHg\\
\hline
Vernier LabQuest datalogger & 1 & NIL\\
\hline
Excell BH-600 electronic balance & 1 & $\pm$0.01g\\
\hline
Apollo vortex mixer & 1 & NIL\\
\hline
Parafilm & NIL & NIL\\
\hline
\end{tabu}
\caption{Table of materials and apparatus}
    \label{tab:ma}
\end{adjustwidth}
    \end{table}
\end{document}

For units you should consider siunitx package.

Addendum: I wondering why the table width is 1.1\textwidth if for example, the cell contents in last column can be stored in narrower column. For example

\begin{tabu} to \textwidth {| X[5] | X[5] | X[4] |}

and removing of adjustwidth your table become:

enter image description here

With this approach you also will not have problems with longtabu tables.

3
  • Also, do you know how I can do the same for the longtabu environment? Since longtabu can't be put in a float environment, I can't use \adjustwidth.
    – Victor Z
    Commented Apr 12, 2017 at 13:09
  • @VictorZ, hm, longtabu (or longtable, the problem is the same) are different story. Since you like to have only 10% wider table as is text width, it is better to consider to shrink table for such amount (by reducing of \tabcolsep or/and used font size in table, then to allow to breake text in cells into more lines, especially column headers). From showed table i wonder, why you like to have so wide table since the most of the columns width is not used.
    – Zarko
    Commented Apr 12, 2017 at 13:55
  • Mm, yeah I agree with you. I read another post (tex.stackexchange.com/questions/97022/…) that called for defining my own environment but to be honest, I don't think it's worth the trouble, and like you said most of the space isn't being used. Well, thanks again @Zarko!
    – Victor Z
    Commented Apr 12, 2017 at 14:41

You must log in to answer this question.

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