Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like to know how to indent a table within the itemize environment.

\documentclass{article}
\begin{document}
Hello. I love \LaTeX! I have a question:
\begin{itemize}
    \item
        How can I indent the table below?

        \begin{tabular}{|rcccl|}
            \hline\\[-10pt]
            this & table & should & be & indented \\
            \hline
        \end{tabular}

\end{itemize}
\end{document}
share|improve this question
    
Welcome to TeX.sx! –  Werner Nov 19 '11 at 0:02
add comment

1 Answer

up vote 3 down vote accepted

You could prepend the tabular with an \hspace*{<len>} where <len> is any known (La)TeX length unit. For example, below I've spaced the tabular by 2em:

enter image description here

\documentclass{article}
\begin{document}
Hello. I love \LaTeX! I have a question:
\begin{itemize}
    \item
        How can I indent the table below?

        \hspace*{2em}\begin{tabular}{|rcccl|}
            \hline
            this & table & should & be & indented \\
            \hline
        \end{tabular}

\end{itemize}
\end{document}​

Using the starred version of \hspace*{<len>} here is not compulsory - \hspace{<len>} would also work.

Note how it is necessary to "unskip" the distance inserted after \hline via \\. I've just removed it from my MWE. Of course, other lengths also exist that you could use (\labelsep comes to mind, which is the length between the bullet and the start of the item text).

share|improve this answer
    
Great answer, thank you! May I ask what the function of the * is in general? –  Will Nov 19 '11 at 0:08
    
See Help with \hspace for some detail on the use of * or not. –  Werner Nov 19 '11 at 0:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.