3

I'm having trouble with a table I have made. It is too long and goes off of the page to the right. I have already made the font smaller and made the page landscape. What I need to do is have the table start farther to the left so the entire thing can fit. Right now the table will start on the indent from the left. In other words, having the entire table centered on the page.

1
  • Welcom to TeX.SX. A minimal working example would be great for us to have to be able to easier help you.
    – Adam Liter
    Commented Jun 18, 2014 at 19:45

2 Answers 2

3

You can also use adjustbox package that offers center option. With this, every thing is centered. Further, it also offers max width option. If you use this, only those objects that are wider than max width value are resized (smaller ones are not).

Some example:

\documentclass{article}
\usepackage{adjustbox,showframe}
\begin{document}
\noindent
\hrulefill

\begin{adjustbox}{center}
\begin{tabular}{|c|}
\hline
\rule{1.2\textwidth}{1ex}\\
Some text \\
\hline
\end{tabular}
\end{adjustbox}

\noindent
Some other text

\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{|c|}
\hline
\rule{1.2\textwidth}{1ex}\\
Some text \\
\hline
\end{tabular}
\end{adjustbox}

%% following table is not re-sized.
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{|c|}
\hline
\rule{0.8\textwidth}{1ex}\\
Some text \\
\hline
\end{tabular}
\end{adjustbox}
\end{document}

enter image description here

1

The \noindent\makebox[\linewidth]{...} should center whatever the argument is. I show the \hrulefill just to show the margin extent, demonstrating that the tabular is centered with respect to the LR margins.

Without seeing a concrete MWE from the OP, not much more can be said.

\documentclass{arlticle}
\begin{document}
\hrulefill

\noindent\makebox[\linewidth]{
\begin{tabular}{|c|}
\hline
\rule{7in}{1ex}\\
\hline
\end{tabular}
}
\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 .