I have used the enumerate environment to create a list
in which every item contains a table, created using
the tabular environment. The first row of each table
should be aligned with the item label, (a), (b), etc.
This is not the the case if the table starts with an
\hline. How can I fix the alignment in such a case?
\documentclass{article}
\usepackage{enumerate}
\begin{document}
\begin{enumerate}[(a)]
\item
\begin{tabular}[t]{|c|c|}
a & b \\ \hline c & d \\ \hline
\end{tabular}
\item
\begin{tabular}[t]{|c|c|}
\hline e & f \\ \hline g & h \\ \hline
\end{tabular}
\end{enumerate}
\end{document}
Best Answer
I just had to solve this problem, and "The LaTeX Companion" (second edition) has the answer on page 280. The
[t]
option aligns the tabular to the\hline
instead of the baseline of the text. Thearray
package has the command\firsthline
which corrects this:This is the result: