# tabularx and array

I need two things for my tables:

1. text has to be able to wrap.
2. the first row has to be bold

For 1, I need the package tabularx. For 2, I need the package array and quite a lot of commands (see Make first row of table all bold)

However if I transpose the above commands into a tabularx (rather than tabular) things won't work (apparently).

Any ideas?

-
You don't need tabularx to have columns with line wrapping a standard latex tabular p column will allow that. Why can't you just start each cell in the first row with \bfseries. – David Carlisle Oct 5 '12 at 16:38
To the best of my knowledge, the problem with tabular p columns is that you have to choose a size, I want LaTeX to conveniently allocate it and this happens well with tabularx. Of course I can bfseries every entry of the first row, but if I am here is because I don't want to. – Ale Oct 5 '12 at 19:28

From your original description it wasn't clear that you need any packages, but I give an example using tabulary (tabularx's younger brother) where the column widths are chosen automatically.

\documentclass{article}

\usepackage{tabulary}

\begin{document}

\begin{tabular}{|p{2cm}|p{3cm}|p{2cm}|}
\bfseries\centering some bold words here&
\bfseries\centering and yet more bold&
\hline
normal weight words go here normal weight words go here
normal weight words go here normal weight words go here
&
different words go here different words go here
different words go here different words go here
different words go here different words go here
&
and this is the third column and this is the third column
and this is the third column and this is the third column
and this is the third column and this is the third column
\end{tabular}

\bigskip

\noindent\begin{tabulary}{\textwidth}{|J|J|J|}
\bfseries\centering some bold words here&
\bfseries\centering and yet more bold&
\hline
normal weight words go here normal weight words go here
normal weight words go here normal weight words go here
&
different words go here different words go here
different words go here different words go here
different words go here different words go here
&
and this is the third column and this is the third column
and this is the third column and this is the third column
and this is the third column and this is the third column
\end{tabulary}

\end{document}

-

You can also use the tabu package and its \rowfont command to easily modify the font and the alignment of each cell in one row:

\documentclass{article}
\usepackage{tabu}
\usepackage{booktabs}

\begin{document}

\noindent\begin{tabu} to \textwidth {@{}XXX<{\strut}@{}}
\toprule
\rowfont[c]{\bfseries}
some bold words here & and yet more bold & heading for third column \\
\midrule
normal weight words go here normal weight words go here
normal weight words go here normal weight words go here
&
different words go here in the second column
different words go here in the second column
different words go here in the second column
&
and this is the third column and this is the third column
and this is the third column and this is the third column
and this is the third column and this is the third column \\
\bottomrule
\end{tabu}

\end{document}


-