Quantcast
Channel: Errors with ragged-right justification in tables - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 4

Errors with ragged-right justification in tables

$
0
0

My main goal is to disable text justification in tables and just have left-aligned text. I've loaded the array package and defined a custom \newcolumntype like so:

\usepackage{array}\newcolumntype{x}[1]{>{\raggedright}p{#1}}

When using this in the tabular environment, everything works fine until the last column, when it throws this error:

./temp.tex:96: Misplaced \noalign.\midrule ->\noalign                      {\ifnum 0=`}\fi \@aboverulesep =\aboverulesep \global \@...l.96     \midrule?

Using \begin{tabular}{@{} x{28mm} x{20mm} x{20mm} p{25mm} @{}} works fine (but throws an underfull \hbox warning) but using \begin{tabular}{@{} x{28mm} x{20mm} x{20mm} x{25mm} @{}} throws the error above.

Why am I not allowed to use my custom column type on the last column? It seems as if I'm missing something obvious to a trivial solution.

With \begin{tabular}{@{} x{28mm} x{20mm} x{20mm} p{25mm} @{}}:

table with underfull \hbox


Viewing all articles
Browse latest Browse all 4

Trending Articles