[texhax] Raggedright in fixed-width table column

Brandon Kuczenski brandon at 301south.net
Mon Feb 11 07:12:48 CET 2008


Hello all,

I am trying to construct a table that looks like this:

\begin{tabular}{l p{10cm}}
...

and then define the entries in the table using this command:

\newcommand{\tableentry}[2]{%
#1 & #2 \\
}

except I would like the text in the 10cm parbox to be raggedright, rather 
than justified.

The only way I have found to do this is in the actual use of the 
\tableentry command:

\tableentry{column 1 text}{\raggedright column 2 text...}

except it seems like I should be able to do this without entering 
\raggedright in every single \tableentry argument.  I would like to 
specify \raggedright in the definition of \tableentry instead of having to 
repeatedly specify it on every invocation.

I have tried:

\newcommand{\tableentry}[2]{%
#1 & {\raggedright #2} \\
}

as well as other variations like \raggedright{#2} and {\raggedright{#2}} 
but none of these achieve the desired result.

Does my question make sense? Is there a solution?

Thanks in advance,
Brandon



More information about the texhax mailing list