TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


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

share|improve this question
Please add a minimal working example (MWE) that illustrates your problem. – Torbjørn T. Nov 18 '11 at 22:47
up vote 18 down vote accepted

It's a known issue. When you say \raggedright, the command \\ is redefined. This causes no harm until you want to terminate a table row: LaTeX finds the \\ as defined by \raggedright which doesn't mean the same thing as normally in tabular. Write


and use \newline if you want to terminate a line in one of the cells. Or use your definition and terminate table rows with \tabularnewline.

share|improve this answer

In addition to the answer by egreg - the command \RaggedRight from ragged2e package does not have this issue. This works:

\usepackage[originalparameters]{ragged2e}  % The option prevents hyphentation rather than making it rare 
share|improve this answer

The simplest solution: add an empty column. Depending on how you've built your table, you can either make it minimal width (with p{size}, for instance) or just let LaTeX figure it out. I used both in a recent paper and it fixed this problem. The only down side is that one of the tables uses \hline and vertical rules, and there's an 'overhang' on the right side of the table. I said, deal with it, life's short.

share|improve this answer
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Symbol 1 Aug 7 '15 at 0:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.