# Vertical alignment of tables when using numbered list in LyX

I have a table on my numbered lists but the number is appearing in the middle, I want it to be at the top like normal. This is what it looks like when using tables. (Screenshot below)

I've attached a picture, I want the number 6 to be the top not the middle.

-
The easy way to do this is to use the [t] optional argument to tabular in LaTeX. There may be an option that can be specified within LyX (can't check now). –  Werner Feb 23 '12 at 21:28
The OP seems to be interested in pure LyX way. He already asked on LaTeX-Community.org where the option [t] has been explained, but he cannot use it. –  Stefan Kottwitz Feb 23 '12 at 21:39
@StefanKottwitz The solution is right but need a way to implement this in lyx. Thanks. –  orange Feb 23 '12 at 21:44

In LyX, click inside the table and follow the menu options Edit ->Table ->Top:

This is equivalent to choosing Edit ->Table Settings... and then selecting Top from the Vertical alignment:

However, this is not the full picture, since your vertical alignment will be slightly off. To correct for this, insert an ERT containing \tabvcorr just before the table, and include the following in your preamble (Document ->Settings... ->LaTeX Preamble):

\newcommand{\tabvcorr}{\mbox{}\par\nobreak\vspace*{-2\baselineskip}}% Table vertical correction


Now your output should compile to:

-

As mentioned in the comment, this can be fixed by giving the optional parameter [t] to the tabular environment.

For future reference, this parameter can be

• t for top justified
• c for centered
• b for bottom justified

\documentclass{article}

\begin{document}

\begin{enumerate}
\item \begin{tabular}[t]{cc}
1 & 2   \\
3   & 4
\end{tabular}
\end{enumerate}

\end{document}

-
Is there a way to implement this in lyx? –  orange Feb 23 '12 at 21:42
@Jeff almost certainly, but I have no idea how to do so. You'll probably get lyx directions in another answer –  cmhughes Feb 23 '12 at 22:05