# Centering tabular data horizontally, without giving it its own page

I have a fairly basic table set up right now:

\documentclass[paper=a4, fontsize=11pt]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage[english]{babel}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage{amsmath,amsfonts,amsthm}
\usepackage[pdftex]{graphicx}
\usepackage{fancyhdr}
\pagestyle{fancyplain}
\fancyfoot[L]{}
\fancyfoot[C]{}
\fancyfoot[R]{}
\usepackage{enumerate}
\usepackage{multicol}
\usepackage[bottom]{footmisc}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\usepackage{footnote}
\makesavenoteenv{tabular}

\begin{document}
\section*{Polynomials}
\begin{align*}
\phi_n \cdot x^{n} \enspace + \enspace \phi_{n-1} \cdot x^{n-1} \enspace + \enspace \phi_{n-2} \cdot x^{n-2} \enspace + \enspace \ldots \enspace + \enspace \phi_2 \cdot x^2 \enspace + \enspace \phi_1 \cdot x^1 \enspace + \enspace \phi_0 \cdot x^0
\end{align*}

For instance, $$4x^4 + \frac{x^2}{2} + x -6$$ looks like:

\begin{table}[H]
\centering
\begin{tabular}{l || c | c}
& $$\phi_n$$ & $$n$$ \\
$$4x^4$$ & $$4$$ & $$4$$ \\
$$\epsilon$$\footnote[2]{meaning "nothing found"} & $$0$$ & $$3$$ \\
$$\frac{x^2}{2}$$ & $$\frac{1}{2}$$ & $$2$$ \\
$$x$$ & $$1$$ & $$1$$ \\
$$-6$$ & $$-6$$ & $$0$$ \\
\end{tabular}
\end{table}

\clearpage

Foofasdfa sdf asdf asdf asdf asf dasfd afd

\end{document}


Except for the fact that this table now takes up its own entire page, and is very small. Is there any way to center the table horizontally like normal text?

• Please edit your question so that it includes a complete example code that reproduces the problem (and delete the spurious apostrophe while you are at it!). I can't see anything wrong with the fragment you have posted. Oct 1 '14 at 19:08
• Sorry about that, I can't seem to break that habit. This reproduces my error, though. Oct 1 '14 at 19:20

You need \usepackage{float} if you want to use the [H] specifier. You should delete \clearpage as well. Here's a simpler example with the same issue.

\documentclass{article}
%\usepackage{float}  % <--- activate to fix problem
\begin{document}
abc
\begin{figure}[H]
\rule{4cm}{4cm}
\end{figure}
def
\end{document}


Without the float package, [H] is invalid, and using an invalid placement specifier prevents the use of the valid options h, t, b and p. Consequently the table is held in the queue and output at the end of the document.

If you don't want the tabular structure to float, and you don't need a caption, then don't put the tabular in a table. The simplest way to get the effect you describe is just to put the tabular in a maths display, like this:

For instance, $$4x^4 + \frac{x^2}{2} + x -6$$ looks like:
$\begin{tabular}{l || c | c} & $$\phi_n$$ & $$n$$ \\ $$4x^4$$ & $$4$$ & $$4$$ \\ $$\epsilon$$\footnote[2]{meaning "nothing found"} & $$0$$ & $$3$$ \\ $$\frac{x^2}{2}$$ & $$\frac{1}{2}$$ & $$2$$ \\ $$x$$ & $$1$$ & $$1$$ \\ $$-6$$ & $$-6$$ & $$0$$ \\ \end{tabular}$


But now you could save yourself some typing by changing the whole thing to an array and getting rid of all the $$...$$ pairs in each row. Like this:

For instance, $$4x^4 + \frac{x^2}{2} + x -6$$ looks like:
$\begin{array}{l || c | c} & \phi_n & n \\ 4x^4 & 4 & 4 \\ \epsilon\footnote[2]{meaning "nothing found"} & 0 & 3 \\ \frac{x^2}{2} & \frac{1}{2} & 2 \\ x & 1 & 1 \\ -6 & -6 & 0 \\ \end{array}$


You will of course also need to set \makesavenoteenv{array} in your preamble, if you want the footnote.

• Your answer was more constructive and educational for newbies like me, but @ian-thompson's was more precisely an immediate solution to my problem. This was very helpful, nonetheless. Thank you! Oct 1 '14 at 22:00
• I'm getting a strange error with this code, though: ! Package array Error: Illegal pream-token (&): c' used. See the array package documentation for explanation. Type H <return> for immediate help. ... l.150 & \phi_n & n \\ Oct 1 '14 at 22:23
• Oh, wait, nevermind. I didn't add the extra argument to \array`. Thank you again! Oct 1 '14 at 22:26