2

I want to use the X command from tabular X to evenly space a tables columns. However, the individual comulns are quite narrow, and this makes the justified spacing look really bad.

Is there anyway to force the X command to be raggedRight instead of justified? I think I could do this on a cell by cell basis, but I have a massive table, and I dont want to do this for every cell. So, is there an alternate command, or some way of creating a new command which would keep the columns spaced evenly, but ragged right?

  • 4
    \usepackage{array}\newcolumntype{R}{>{\raggedright\arraybackslash}X} and then using R column should do the trick. – yo' Feb 26 '15 at 01:05
  • This question is similar to Centering in tabularx and X columns. You can use \renewcommand{\tabularxcolumn}[1]{>{\raggedright\arraybackslash}p{#1}}, or define a new column type altogether so and use that column instead of X. – Werner Feb 26 '15 at 01:06
  • 1
    Regarding >{\raggedright\arraybackslash}X, see section 4.2 of the tabularx documentation. – erik Feb 26 '15 at 01:07
  • 2
    You could load the ragged2e package (in addition to the tabularx package) and define \newcolumntype{R}{>{\RaggedRight\arraybackslash}X}. That way, hyphenation is enabled for the material in the R columns, which makes for less-ragged-looking appearance. – Mico Feb 26 '15 at 06:35
  • 1
    @yo' - The tabularx package loads the array package -- need to load array explicitly. :-) – Mico Feb 26 '15 at 06:36

0 Answers0