hi everyone
I have been wrestling with a latex table for far too long. I need a table that has has centered headers, and body cells that contain text that may wrap around. Because of the wrap-around requirement, i'm using p{xxx} instead of l for specifying cell widths. The problem this causes is that cell contents are not left justified, so the look like spaced-out junk. To fix this problem I'm using \flushleft for each cell. This does left justify contents, but puts in a ton of white space above and below the contents of the cell. Is there a way to stop \flushleft (or \center for that matter) to stop adding copious amounts of verical whitespace?
thanks
\begin{landscape}
\centering
% using p{xxx} here to wrap long text instead of overflowing it
\begin{longtable}{ | p{4cm} || p{3cm} | p{3cm} | p{3cm} | p{3cm} | p{3cm} |}
\hline
&
% these are table headings. the \center is causing a ton of whitespace as well
\begin{center} \textbf{HTC HD2} \end{center} &
\begin{center} \textbf{Motorola Milestone} \end{center} &
\begin{center} \textbf{Nokia N900} \end{center} &
\begin{center} \textbf{RIM Blackberry Bold 9700} \end{center} &
\begin{center} \textbf{Apple iPhone 3GS} \end{center} \\
\hline
\hline
% using flushleft here to left-justify, but again it is causing a ton of white space above and below cell contents.
\begin{flushleft}OS / Platform \end{flushleft}&
\begin{flushleft}Windows Mobile 6.5 \end{flushleft}&
\begin{flushleft}Google Android 2.1 \end{flushleft}&
\begin{flushleft}Maemo \end{flushleft}&
\begin{flushleft}Blackberry OS 5.0 \end{flushleft}&
\begin{flushleft}iPhone OS 3.1 \end{flushleft} \\
\hline
Edit:
Thanks for the answers so far. I thought I found a solution that works, but these problems still exist:
- using \raggedright stops long words from being hyphenated. This looks pretty bad when a cell contains a bunch of lines with only one word in them.
using \raggedright only works if you end it with a blank line. This causes every cell to have a completely blank line at the bottom of it. This was what i was trying to avoid in the first place.
{Display} & {\raggedright 4.3 inch, 800 x 400 resolution} & {\raggedright 3.7 inch, 854 x 480 resolution} & {\raggedright 3.5 inch, 800 x 480 resolution} & {\raggedright 2.44 inch, 320 x 480 resolution} & {\raggedright 3.5 inch, 480 x 320 resolution} \\ \hline