5

This is obliquely related to this query, except that I would like to have a tabularx environment where the entire first column is in italics (or some other standard formatting). The following obviously does not work:

\documentclass{article}
\usepackage{array, tabularx}
\begin{document}
\begin{table}[htbp]
\begin{tabularx}{\linewidth}{>{\em}X{}<XX}
a & a & a \\
b & b & b
\end{tabularx} 
\end{table}
\end{document}

I do actually need tabularx since I expect the last column to contain quite long sentences.

David Carlisle
  • 757,742
tchakravarty
  • 2,427
  • 3
  • 26
  • 45
  • 1
    answer already given but your code would have worked apart from {}< which should be omitted or should be <{} (Using \itshape is most likely more semantically correct than using \em but it would have worked) – David Carlisle Oct 15 '12 at 16:28
  • Thanks David. I thought that this feature was not allowed with tabularx, not noticing that I was making a typo. – tchakravarty Oct 16 '12 at 01:00

1 Answers1

5

Using {>{\itshape\arraybackslash}XXX} works:

\documentclass{article}
\usepackage{array, tabularx}
\begin{document}
\begin{table}[htbp]
\begin{tabularx}{\linewidth}{>{\itshape\arraybackslash}XXX}
a & a & a \\
b & b & b
\end{tabularx}
\end{table}
\end{document}

enter image description here

David Carlisle
  • 757,742