This seems to be a pretty common problem, but I haven't found a satisfactory solution.
I want to have a tabular with an \hline at the top in which the contents of the top row are aligned with an enumeration. So far I've managed to get the following unsatisfactory results:
- the enumeration is aligned with the centre of the tabular
- the enumeration is aligned with the top row of the tabular, but no \hline is included
- the enumeration is aligned with the \hline of the tabular
Code: Select all
Code, edit and compile here:
\documentclass[a4paper,12pt]{article}\usepackage{pifont}\usepackage[table]{xcolor}\usepackage{gb4e}\begin{document}Here is a MWE with the three (unsatisfactory) results:\begin{exe}\ex{\begin{tabular}{|rrl||c|c|} \hline %enumeration aligned centrally%\ex{\begin{tabular}[t]{|rrl||c|c|} \hline %enumeration aligned with \hline%\ex{\begin{tabular}[t]{|rrl||c|c|} %enumeration aligned with top row (but no \hline)\multicolumn{3}{|c||}{Input:~/xxx/} & xxx & xxx \\[0.5ex]\hline \hline a. & \ding{43} & xxx & & \cellcolor{lightgray}{$\ast$} \\\hline b. & & xxx & {$\ast$}! & \cellcolor{lightgray} \\ \hline\end{tabular}}\end{exe}\end{document}