0

In a long document I have several tables which spread over more than one page. Most of them contain a lot of text so I'm using tabularx package to have the right distribution of column widths. I did this following the advice from some other question from here (can't find it now) using ltablex package, and have the following document. (example)

\documentclass[12pt,a4paper,twoside,table]{report}

\usepackage{textcomp}                               
\usepackage{lmodern}                                
\usepackage{helvet}                                 
\usepackage[T1]{fontenc}                            
\usepackage[english]{babel}                         
\usepackage[utf8]{inputenc}                             
     \usepackage[]{xcolor}                  
     \definecolor{steelblue}{RGB}{70,130,180}
    \usepackage{tabularx}    
\usepackage[labelfont=bf,textfont=normal,justification=justified,singlelinecheck=false]{caption}    
    \usepackage{ltablex}

    \begin{document}

\footnotesize
\renewcommand\arraystretch{1.25} 
\begin{tabularx}{\textwidth}{
     >{\setlength\hsize{0.5  \hsize}\centering}X
     >{\setlength\hsize{0.15  \hsize}\centering}X
     >{\setlength\hsize{0.17 \hsize}\centering}X
     >{\setlength\hsize{0.08 \hsize}\centering}X
     >{\setlength\hsize{0.1 \hsize}\centering}X}  
     \caption{\small Sample caption.} \\
     \label{tab:qfd}
\rowcolor{steelblue} \textcolor{white}{Quality Characteristics  ( Requirements)} & \textcolor{white}{Minimize, Maximize, or Target}  & \textcolor{white}{Max Relationship}  & \textcolor{white}{Requirement  Weight} & \textcolor{white}{Relative Weight}   \tabularnewline
Possibility of Automation                                             & maximize                                                                & 9                                                                  & 14,64               & 1,14\%                                  \tabularnewline
Curling                                                               & minimize                                                                & 1                                                                  & 1,50                & 0,12\%                                  \tabularnewline
Young's modulus                                                       & minimize                                                                & 3                                                                  & 10,26               & 0,80\%                                  \tabularnewline
Peel-off adhesion                                                     & maximize                                                                & 9                                                                  & 47,62               & 3,72\%                             \tabularnewline
Presence of characteristic feature                                    &target                                                               & 1                                                                  & 1,50                & 0,12\%                                  \tabularnewline
Substrate preparation time                                            & minimize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Number of steps                                                       & minimize                                                                & 3                                                                  & 5,13                & 0,40\%                                  \tabularnewline
time of application                                                   & minimize                                                                & 9                                                                  & 19,89               & 1,55\%                                  \tabularnewline
Film preparation time                                                 & minimize                                                                & 3                                                                  & 5,13                & 0,40\%                                  \tabularnewline
Equipment Cost                                                        & minimize                                                                & 3                                                                  & 4,50                & 0,35\%                                  \tabularnewline
Consumables cost per hour                                             & minimize                                                                & 9                                                                  & 13,51               & 1,05\%                                  \tabularnewline
Material cost per area                                                & minimize                                                                & 9                                                                  & 13,89               & 1,08\%                                  \tabularnewline
Wetting                                                               & minimize                                                                & 9                                                                  & 28,44               & 2,22\%                                  \tabularnewline
Maximum Heat Absorption                                               & minimize                                                                & 9                                                                  & 14,14               & 1,10\%                                  \tabularnewline
Stain resistance                                                      & maximize                                                                & 9                                                                  & 34,28               & 2,67\%                                  \tabularnewline
Surface texture                                                       &target                                                               & 9                                                                  & 85,20               & 6,65\%                                  \tabularnewline
Area of residue left                                                  & minimize                                                                & 9                                                                  & 16,51               & 1,29\%                                  \tabularnewline
Self-healing properties                                               &target                                                               & 9                                                                  & 22,27               & 1,74\%                                  \tabularnewline
Ability of repair with DIY paint repair kits (decorative only)        &target                                                               & 3                                                                  & 5,00                & 0,39\%                                  \tabularnewline
Polishing quality                                                     & maximize                                                                & 3                                                                  & 5,00                & 0,39\%                                  \tabularnewline
Scratch resistance                                                    & maximize                                                                & 9                                                                  & 34,15               & 2,66\%                                  \tabularnewline
Edge Roughness                                                        & minimize                                                                & 9                                                                  & 38,78               & 3,03\%                                  \tabularnewline
Presence of adhesive                                                  &target                                                               & 9                                                                  & 16,51               & 1,29\%                                  \tabularnewline
Cling adhesion                                                        &target                                                               & 3                                                                  & 7,51                & 0,59\%                                  \tabularnewline
Opacity                                                               & maximize                                                                & 9                                                                  & 15,80               & 1,23\%                                  \tabularnewline
Colour deviation                                                      & minimize                                                                & 9                                                                  & 76,19               & 5,94\%                                  \tabularnewline
Thickness                                                             & minimize                                                                & 9                                                                  & 29,98               & 2,34\%                                  \tabularnewline
Edge visibility                                                       & minimize                                                                & 9                                                                  & 22,77               & 1,78\%                                  \tabularnewline
Gloss                                                                 &target                                                               & 9                                                                  & 55,80               & 4,35\%                                  \tabularnewline
Transmittance of protective film                                      & maximize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Presence of bubbles                                                   &target                                                               & 9                                                                  & 18,02               & 1,41\%                                  \tabularnewline
Features supporting bubble-free application                           &target                                                               & 3                                                                  & 6,01                & 0,47\%                                  \tabularnewline
Orange peel look                                                      &target                                                             & 9                                                                  & 18,02               & 1,41\%                                  \tabularnewline
Variation in surface roughness                                        & minimize                                                                & 9                                                                  & 11,63               & 0,91\%                                  \tabularnewline
Rubbing wear resistance                                               & maximize                                                                & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Reactivity with chemical substances                                   &target                                                              & 9                                                                  & 39,41               & 3,07\%                                  \tabularnewline
Abrasion Resistance                                                   & maximize                                                                & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Nano-scratch resistance                                               & maximize                                                                & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Elongation                                                            &target                                                               & 9                                                                  & 23,52               & 1,83\%                                  \tabularnewline
Stone chipping resistance                                             & maximize                                                                & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Impact toughness                                                      & maximize                                                                & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Shear adhesion                                                        & maximize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Edge adhesion                                                         & maximize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Pressure adhesion                                                     & maximize                                                                & 3                                                                  & 5,13                & 0,40\%                                  \tabularnewline
Surface Energy                                                        & maximize                                                                & 9                                                                  & 18,39               & 1,43\%                                  \tabularnewline
Possibility to apply custom colour                                    &target                                                              & 9                                                                  & 14,64               & 1,14\%                                 \tabularnewline
Printability                                                          &target                                                               & 3                                                                  & 4,88                & 0,38\%                                  \tabularnewline
Possible to store in production area                                  &target                                                               & 9                                                                  & 12,39               & 0,97\%                                  \tabularnewline
Colour changing properties                                            &target                                                               & 9                                                                  & 9,76                & 0,76\%                                  \tabularnewline
Thermal conductivity                                                  &target                                                               & 9                                                                  & 14,39               & 1,12\%                                  \tabularnewline
Thermal expansion coefficient                                         &target                                                               & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Minimum operating temperature                                         &target                                                               & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Maximum operating temperature                                         &target                                                               & 9                                                                  & 20,52               & 1,60\%                                  \tabularnewline
Hardness                                                              & maximize                                                                & 3                                                                  & 5,13                & 0,40\%                                  \tabularnewline
Change in toughness per time                                          & minimize                                                                & 3                                                                  & 5,13                & 0,40\%                                  \tabularnewline
Gloss loss over time                                                  & minimize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Corrosion resistance                                                  & maximize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Water absorption                                                      & maximize                                                                & 9                                                                  & 29,23               & 2,28\%                                  \tabularnewline
Air tightness                                                         & maximize                                                                & 3                                                                  & 5,75                & 0,45\%                                  \tabularnewline
Solubility in water                                                   &target                                                               & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Shrinkage                                                             & minimize                                                               & 9                                                                  & 17,26               & 1,35\%                                  \tabularnewline
Yellowing                                                             & minimize                                                                & 9                                                                  & 18,02               & 1,41\%                                  \tabularnewline
Presence of toxic substances                                          &target                                                               & 9                                                                  & 18,77               & 1,46\%                                  \tabularnewline
Toxicity after disposal                                               &target                                                               & 9                                                                  & 18,77               & 1,46\%                                  \tabularnewline
Flammability                                                          &target                                                               & 9                                                                  & 18,77               & 1,46\%                                  \tabularnewline
Percentage content of recyclable materials                            & maximize                                                                & 9                                                                  & 16,51               & 1,29\%                                  \tabularnewline
Presence of standard Toxic substances                                 &target                                                               & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Friction drag coefficient                                             & minimize                                                                & 9                                                                  & 9,38                & 0,73\%                                  \tabularnewline
Mass per area                                                         & minimize                                                                & 9                                                                  & 13,14               & 1,02\%                                  \tabularnewline
Usage of special or specific tools                                    &target                                                               & 3                                                                  & 3,50                & 0,27\%                                \tabularnewline \hline
\end{tabularx}

\end{document}

Now, until recently I have been mostly working with ShareLaTeX, which was able to compile the document and show me the results.

However I am now switching to using TeXstudio, and when trying to compile the table there, the log displays the errors shown below. Having returned to ShareLaTeX, I found that it also shows the same errors, but is able to display the result, and the result is satisfying.

    ! LaTeX Error: Something's wrong--perhaps a missing \item.

    See the LaTeX manual or LaTeX Companion for explanation.
    Type  H <return>  for immediate help.
     ...                                              

    l.101 \end{tabularx}

    Try typing  <return>  to proceed.
    If that doesn't work, type  X <return>  to quit.



    ! Misplaced \noalign.
    \rowcolor ->\noalign 
                         {\ifnum 0=`}\fi \global \let \CT@do@color \CT@@do@color...
    l.101 \end{tabularx}

    I expect to see \noalign only after the \cr of
    an alignment. Proceed, and I'll ignore this case.

    ! LaTeX Error: There's no line here to end.

    See the LaTeX manual or LaTeX Companion for explanation.
    Type  H <return>  for immediate help.
     ...                                              

    l.101 \end{tabularx}

    Your command was ignored.
    Type  I <command> <return>  to replace it with another command,
    or  <return>  to continue without it.

! LaTeX Error: There's no line here to end.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.101 \end{tabularx}

Your command was ignored.
Type  I <command> <return>  to replace it with another command,
or  <return>  to continue without it.

These errors are repeated multiple times; I only copied part of the log without them repeating. I have at least four other tables like this and the same kinds of errors appear in each of them.

I'm rather new to TeX in general, only using it for university documents, so there may be something stupidly obvios wrong with it, but I cannot spot anything in particular.

Thanks in advance!

  • 1
    Why do you use those \setlength commands? – TeXnician Jul 6 '17 at 16:43
  • Welcome to TeX.SX! – Bobyandbob Jul 6 '17 at 16:43
  • @TeXnician This is the way I was taught by my colleague, and since it has worked for shorter tables with no errors, I have never questioned this way. – Slovakov Jul 6 '17 at 16:47
  • 1
    @TeXnician Take a look at tablex doc – Arzigoglu Jul 6 '17 at 17:19
  • 1
    @TeXnician that would be the official latex syntax for setting \hsize – David Carlisle Jul 6 '17 at 17:28
2

The problem is like when you have a \caption inside a non-floating environment (tabularx), although ltablex defines tabularx to be longtable which defines \caption.

Use \captionof{table}{...} outside tabularx to obtain what you want.

MWE (I didn't adjust the columns, left to you as an exercise)

\documentclass[12pt,a4paper,twoside,table]{report}

\usepackage{textcomp}
\usepackage{lmodern}
\usepackage{helvet}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
     \usepackage[]{xcolor}
     \definecolor{steelblue}{RGB}{70,130,180}
    \usepackage{tabularx}
\usepackage[labelfont=bf,textfont=normal,justification=justified,singlelinecheck=false]{caption}
    \usepackage{ltablex}

\begin{document}

\footnotesize
\renewcommand\arraystretch{1.25}
\captionof{table}{\small Sample caption.}\label{tab:qfd}
\begin{tabularx}{\textwidth}{
     >{\setlength\hsize{0.5  \hsize}\centering}X
     >{\setlength\hsize{0.15  \hsize}\centering}X
     >{\setlength\hsize{0.17 \hsize}\centering}X
     >{\setlength\hsize{0.08 \hsize}\centering}X
     >{\setlength\hsize{0.1 \hsize}\centering}X}
\rowcolor{steelblue} \textcolor{white}{Quality Characteristics  (Requirements)} & \textcolor{white}{Minimize, Maximize, or Target}  & \textcolor{white}{Max Relationship}  & \textcolor{white}{Requirement  Weight} & \textcolor{white}{Relative Weight}   \tabularnewline
Possibility of Automation                                             & maximize                                                                & 9                                                                  & 14,64               & 1,14\%                                  \tabularnewline
Curling                                                               & minimize                                                                & 1                                                                  & 1,50                & 0,12\%                                  \tabularnewline
Young's modulus                                                       & minimize                                                                & 3                                                                  & 10,26               & 0,80\%                                  \tabularnewline
Peel-off adhesion                                                     & maximize                                                                & 9                                                                  & 47,62               & 3,72\%                             \tabularnewline
Presence of characteristic feature                                    &target                                                               & 1                                                                  & 1,50                & 0,12\%                                  \tabularnewline
Substrate preparation time                                            & minimize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Number of steps                                                       & minimize                                                                & 3                                                                  & 5,13                & 0,40\%                                  \tabularnewline
time of application                                                   & minimize                                                                & 9                                                                  & 19,89               & 1,55\%                                  \tabularnewline
Film preparation time                                                 & minimize                                                                & 3                                                                  & 5,13                & 0,40\%                                  \tabularnewline
Equipment Cost                                                        & minimize                                                                & 3                                                                  & 4,50                & 0,35\%                                  \tabularnewline
Consumables cost per hour                                             & minimize                                                                & 9                                                                  & 13,51               & 1,05\%                                  \tabularnewline
Material cost per area                                                & minimize                                                                & 9                                                                  & 13,89               & 1,08\%                                  \tabularnewline
Wetting                                                               & minimize                                                                & 9                                                                  & 28,44               & 2,22\%                                  \tabularnewline
Maximum Heat Absorption                                               & minimize                                                                & 9                                                                  & 14,14               & 1,10\%                                  \tabularnewline
Stain resistance                                                      & maximize                                                                & 9                                                                  & 34,28               & 2,67\%                                  \tabularnewline
Surface texture                                                       &target                                                               & 9                                                                  & 85,20               & 6,65\%                                  \tabularnewline
Area of residue left                                                  & minimize                                                                & 9                                                                  & 16,51               & 1,29\%                                  \tabularnewline
Self-healing properties                                               &target                                                               & 9                                                                  & 22,27               & 1,74\%                                  \tabularnewline
Ability of repair with DIY paint repair kits (decorative only)        &target                                                               & 3                                                                  & 5,00                & 0,39\%                                  \tabularnewline
Polishing quality                                                     & maximize                                                                & 3                                                                  & 5,00                & 0,39\%                                  \tabularnewline
Scratch resistance                                                    & maximize                                                                & 9                                                                  & 34,15               & 2,66\%                                  \tabularnewline
Edge Roughness                                                        & minimize                                                                & 9                                                                  & 38,78               & 3,03\%                                  \tabularnewline
Presence of adhesive                                                  &target                                                               & 9                                                                  & 16,51               & 1,29\%                                  \tabularnewline
Cling adhesion                                                        &target                                                               & 3                                                                  & 7,51                & 0,59\%                                  \tabularnewline
Opacity                                                               & maximize                                                                & 9                                                                  & 15,80               & 1,23\%                                  \tabularnewline
Colour deviation                                                      & minimize                                                                & 9                                                                  & 76,19               & 5,94\%                                  \tabularnewline
Thickness                                                             & minimize                                                                & 9                                                                  & 29,98               & 2,34\%                                  \tabularnewline
Edge visibility                                                       & minimize                                                                & 9                                                                  & 22,77               & 1,78\%                                  \tabularnewline
Gloss                                                                 &target                                                               & 9                                                                  & 55,80               & 4,35\%                                  \tabularnewline
Transmittance of protective film                                      & maximize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Presence of bubbles                                                   &target                                                               & 9                                                                  & 18,02               & 1,41\%                                  \tabularnewline
Features supporting bubble-free application                           &target                                                               & 3                                                                  & 6,01                & 0,47\%                                  \tabularnewline
Orange peel look                                                      &target                                                             & 9                                                                  & 18,02               & 1,41\%                                  \tabularnewline
Variation in surface roughness                                        & minimize                                                                & 9                                                                  & 11,63               & 0,91\%                                  \tabularnewline
Rubbing wear resistance                                               & maximize                                                                & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Reactivity with chemical substances                                   &target                                                              & 9                                                                  & 39,41               & 3,07\%                                  \tabularnewline
Abrasion Resistance                                                   & maximize                                                                & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Nano-scratch resistance                                               & maximize                                                                & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Elongation                                                            &target                                                               & 9                                                                  & 23,52               & 1,83\%                                  \tabularnewline
Stone chipping resistance                                             & maximize                                                                & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Impact toughness                                                      & maximize                                                                & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Shear adhesion                                                        & maximize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Edge adhesion                                                         & maximize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Pressure adhesion                                                     & maximize                                                                & 3                                                                  & 5,13                & 0,40\%                                  \tabularnewline
Surface Energy                                                        & maximize                                                                & 9                                                                  & 18,39               & 1,43\%                                  \tabularnewline
Possibility to apply custom colour                                    &target                                                              & 9                                                                  & 14,64               & 1,14\%                                 \tabularnewline
Printability                                                          &target                                                               & 3                                                                  & 4,88                & 0,38\%                                  \tabularnewline
Possible to store in production area                                  &target                                                               & 9                                                                  & 12,39               & 0,97\%                                  \tabularnewline
Colour changing properties                                            &target                                                               & 9                                                                  & 9,76                & 0,76\%                                  \tabularnewline
Thermal conductivity                                                  &target                                                               & 9                                                                  & 14,39               & 1,12\%                                  \tabularnewline
Thermal expansion coefficient                                         &target                                                               & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Minimum operating temperature                                         &target                                                               & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Maximum operating temperature                                         &target                                                               & 9                                                                  & 20,52               & 1,60\%                                  \tabularnewline
Hardness                                                              & maximize                                                                & 3                                                                  & 5,13                & 0,40\%                                  \tabularnewline
Change in toughness per time                                          & minimize                                                                & 3                                                                  & 5,13                & 0,40\%                                  \tabularnewline
Gloss loss over time                                                  & minimize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Corrosion resistance                                                  & maximize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Water absorption                                                      & maximize                                                                & 9                                                                  & 29,23               & 2,28\%                                  \tabularnewline
Air tightness                                                         & maximize                                                                & 3                                                                  & 5,75                & 0,45\%                                  \tabularnewline
Solubility in water                                                   &target                                                               & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Shrinkage                                                             & minimize                                                               & 9                                                                  & 17,26               & 1,35\%                                  \tabularnewline
Yellowing                                                             & minimize                                                                & 9                                                                  & 18,02               & 1,41\%                                  \tabularnewline
Presence of toxic substances                                          &target                                                               & 9                                                                  & 18,77               & 1,46\%                                  \tabularnewline
Toxicity after disposal                                               &target                                                               & 9                                                                  & 18,77               & 1,46\%                                  \tabularnewline
Flammability                                                          &target                                                               & 9                                                                  & 18,77               & 1,46\%                                  \tabularnewline
Percentage content of recyclable materials                            & maximize                                                                & 9                                                                  & 16,51               & 1,29\%                                  \tabularnewline
Presence of standard Toxic substances                                 &target                                                               & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Friction drag coefficient                                             & minimize                                                                & 9                                                                  & 9,38                & 0,73\%                                  \tabularnewline
Mass per area                                                         & minimize                                                                & 9                                                                  & 13,14               & 1,02\%                                  \tabularnewline
Usage of special or specific tools                                    &target                                                               & 3                                                                  & 3,50                & 0,27\%                                \tabularnewline \hline
\end{tabularx}

\end{document} 

enter image description here

  • 2
    See David's comment here: tex.stackexchange.com/a/188701/117534. ltablexdefines tabularx to be a longtable, so caption within tabularx is fine. The documentation for ltablex also gives an example with caption inside tabularx – Troy Jul 6 '17 at 17:29
  • @Troy It seems that David's workaround doesn't work in this case... – Arzigoglu Jul 6 '17 at 17:39
  • Thank you Arzigoglu, it solves all errors. @Troy This removes all the errors but I can't see the caption. – Slovakov Jul 6 '17 at 17:43
  • @Slovakov Probably go with Arzigoglu's answer for now. The workaround from the link doesn't seem to work in your case, and I'm not good enough to know why. I was just pointing out that 'caption inside tabularx` when using ltablex is not wrong. – Troy Jul 6 '17 at 17:52
  • @Troy I hope the edit is fine for you. – Arzigoglu Jul 6 '17 at 17:58
2

The main error, I think, it the way the relative lengths are set for the X columns. The sum of the coefficients must not be equal to 1, but to the number of columns, 5, in your version.

I improved your table using the S column type from siunitx, to have an alignment on the decimal dot, and used the \thead command from makecell to have a common formatting of the column heads and linebreaks inside these heads.

\documentclass[12pt,a4paper,twoside,table, svgnames, x11names]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{lmodern}
\usepackage{helvet}
\usepackage[english]{babel}
\usepackage{siunitx, makecell, booktabs}
\renewcommand\theadfont{\color{white}}%
 \usepackage{xcolor}
 \definecolor{steelblue}{RGB}{70,130,180}
\usepackage[labelfont=bf,textfont=normal,justification=justified,singlelinecheck=false]{caption}
\usepackage{ltablex}
\renewcommand{\tabularxcolumn}[1]{ >{\centering\arraybackslash}m{#1}}

\begin{document}

\footnotesize
\renewcommand\arraystretch{1.25}\setlength\tabcolsep{3pt}
\begin{tabularx}{\textwidth}{
  >{\hsize=1.55\hsize}X
  >{\hsize=0.45\hsize}X
  cS[table-format=2.2, table-column-width =2cm]S[table-format=1.2]}
  \caption{\small Sample caption.}
  \label{tab:qfd} \\
  \rowcolor{steelblue} \thead{Quality Characteristics \\(Requirements)} & \thead{Minimize, \\Maximize,\\ or Target} & {\thead{Max \\Relationship}} &{\thead{Requirement\\ Weight}} &{\thead{Relative\\ Weight (\%)}}\\\addlinespace
  \endfirsthead
  %%%%%%%%%%%%%%%%%
  \rowcolor{steelblue} \thead{Quality Characteristics \\(Requirements)} & \thead{Minimize, \\Maximize,\\ or Target} & {\thead{Max \\Relationship}} &{\thead{Requirement\\ Weight}} &{\thead{Relative\\ Weight (\%)}} \\\addlinespace
  \endhead
 %%%%%%%%%%%%%%%%%
  \bottomrule
  \multicolumn{5}{r}{\scriptsize to be continued}
  \endfoot
  %%%%%%%%%%%%%%%%%
  \bottomrule
  \endlastfoot
  %%%%%%%%%%%%%%%%%
  Possibility of Automation & maximize & 9 & 14,64 & 1,14 \\
  Curling & minimize & 1 & 1,50 & 0,12 \\
  Young's modulus & minimize & 3 & 10,26 & 0,80 \\
  Peel-off adhesion & maximize & 9 & 47,62 & 3,72 \\
  Presence of characteristic feature & target & 1 & 1,50 & 0,12 \\
  Substrate preparation time & minimize & 9 & 15,39 & 1,20 \\
  Number of steps & minimize & 3 & 5,13 & 0,40 \\
  time of application & minimize & 9 & 19,89 & 1,55 \\
  Film preparation time & minimize & 3 & 5,13 & 0,40 \\
  Equipment Cost & minimize & 3 & 4,50 & 0,35 \\
  Consumables cost per hour & minimize & 9 & 13,51 & 1,05 \\
  Material cost per area & minimize & 9 & 13,89 & 1,08 \\
  Wetting & minimize & 9 & 28,44 & 2,22 \\
  Maximum Heat Absorption & minimize & 9 & 14,14 & 1,10 \\
  Stain resistance & maximize & 9 & 34,28 & 2,67 \\
  Surface texture & target & 9 & 85,20 & 6,65 \\
  Area of residue left & minimize & 9 & 16,51 & 1,29 \\
  Self-healing properties & target & 9 & 22,27 & 1,74 \\
  Ability of repair with\break DIY paint repair kits\break (decorative only) & target & 3 & 5,00 & 0,39 \\
  Polishing quality & maximize & 3 & 5,00 & 0,39 \\
  Scratch resistance & maximize & 9 & 34,15 & 2,66 \\
  Edge Roughness & minimize & 9 & 38,78 & 3,03 \\
  Presence of adhesive & target & 9 & 16,51 & 1,29 \\
  Cling adhesion & target & 3 & 7,51 & 0,59 \\
  Opacity & maximize & 9 & 15,80 & 1,23 \\
  Colour deviation & minimize & 9 & 76,19 & 5,94 \\
  Thickness & minimize & 9 & 29,98 & 2,34 \\
  Edge visibility & minimize & 9 & 22,77 & 1,78 \\
  Gloss & target & 9 & 55,80 & 4,35 \\
  Transmittance of\break protective film & maximize & 9 & 15,39 & 1,20 \\
  Presence of bubbles & target & 9 & 18,02 & 1,41 \\
  Features supporting\break bubble-free application & target & 3 & 6,01 & 0,47 \\
  Orange peel look & target & 9 & 18,02 & 1,41 \\
  Variation in surface roughness & minimize & 9 & 11,63 & 0,91 \\
  Rubbing wear resistance & maximize & 9 & 16,89 & 1,32 \\
  Reactivity with \break chemical substances & target & 9 & 39,41 & 3,07 \\
  Abrasion Resistance & maximize & 9 & 16,89 & 1,32 \\
  Nano-scratch resistance & maximize & 9 & 16,89 & 1,32 \\
  Elongation & target & 9 & 23,52 & 1,83 \\
  Stone chipping resistance & maximize & 9 & 16,89 & 1,32 \\
  Impact toughness & maximize & 9 & 16,89 & 1,32 \\
  Shear adhesion & maximize & 9 & 15,39 & 1,20 \\
  Edge adhesion & maximize & 9 & 15,39 & 1,20 \\
  Pressure adhesion & maximize & 3 & 5,13 & 0,40 \\
  Surface Energy & maximize & 9 & 18,39 & 1,43 \\
  Possibility to apply custom colour & target & 9 & 14,64 & 1,14 \\
  Printability & target & 3 & 4,88 & 0,38 \\
  Possible to store\break in production area & target & 9 & 12,39 & 0,97 \\
  Colour changing properties & target & 9 & 9,76 & 0,76 \\
  Thermal conductivity & target & 9 & 14,39 & 1,12 \\
  Thermal expansion coefficient & target & 9 & 15,39 & 1,20 \\
  Minimum operating temperature & target & 9 & 15,39 & 1,20 \\
  Maximum operating temperature & target & 9 & 20,52 & 1,60 \\
  Hardness & maximize & 3 & 5,13 & 0,40 \\
  Change in toughness per time & minimize & 3 & 5,13 & 0,40 \\
  Gloss loss over time & minimize & 9 & 15,39 & 1,20 \\
  Corrosion resistance & maximize & 9 & 15,39 & 1,20 \\
  Water absorption & maximize & 9 & 29,23 & 2,28 \\
  Air tightness & maximize & 3 & 5,75 & 0,45 \\
  Solubility in water & target & 9 & 15,39 & 1,20 \\
  Shrinkage & minimize & 9 & 17,26 & 1,35 \\
  Yellowing & minimize & 9 & 18,02 & 1,41 \\
  Presence of toxic substances & target & 9 & 18,77 & 1,46 \\
  Toxicity after disposal & target & 9 & 18,77 & 1,46 \\
  Flammability & target & 9 & 18,77 & 1,46 \\
  Percentage content of \break recyclable materials & maximize & 9 & 16,51 & 1,29 \\
  Presence of standard \break Toxic substances & target & 9 & 16,89 & 1,32 \\
  Friction drag coefficient & minimize & 9 & 9,38 & 0,73 \\
  Mass per area & minimize & 9 & 13,14 & 1,02 \\
  Usage of special \break or specific tools & target & 3 & 3,50 & 0,27
\end{tabularx}

\end{document} 

enter image description here

1

I think I might have found the reason for the error, but I'm not 100% about it.

Consider the MWE (shortened version of OP's problematic code):

\documentclass{report}
\usepackage{tabularx}    
\usepackage[labelfont=bf,textfont=normal,justification=justified,singlelinecheck=false]{caption}    
\usepackage{ltablex}

\begin{document}
    \begin{tabularx}{\textwidth}{
            >{\setlength\hsize{0.5  \hsize}\centering}X
            >{\setlength\hsize{0.15  \hsize}\centering}X
            >{\setlength\hsize{0.17 \hsize}\centering}X
            >{\setlength\hsize{0.08 \hsize}\centering}X
            >{\setlength\hsize{0.1 \hsize}\centering}X}  
%           \caption{\small Sample caption.\label{tab:qfd}} \tabularnewline
        A & B  & C  & D & E   \tabularnewline
        \hline
        1 & 2 & 3 & 4 & 5     \tabularnewline
    \end{tabularx}
\end{document}

1) It compiles fine when the \caption is commented out, but gives an error about a ...missing \item when \caption is left in, similar to what OP reports.

2) Leaving \caption commented out, and changing one of the \tabularnewline to \\, we get error as well.

which leads me to think that it might have something to do with \\ vs. \tabularnewline. Now, the typical solution for that is to include \arraybackslash from the array package which basically has the definition:

\def\arraybackslash{\let\\\tabularnewline}

If we include \arraybackslash in (and a slight modification with \newcolumntype to make things more compact):

\documentclass{report}
\usepackage{tabularx}    
\usepackage[labelfont=bf,textfont=normal,justification=justified,singlelinecheck=false]{caption}    
\usepackage{ltablex}

\newcolumntype{Y}[1]{>{\setlength\hsize{#1\hsize}\centering\arraybackslash}X}
\begin{document}
    \begin{tabularx}{\textwidth}{Y{0.5}Y{0.15}Y{0.17}Y{0.08}Y{0.1}}  
            \caption{\small Sample caption.\label{tab:qfd}} \tabularnewline
        A & B  & C  & D & E   \tabularnewline
        \hline
        1 & 2 & 3 & 4 & 5     \tabularnewline
    \end{tabularx}
\end{document}

It now works with the caption included within the tabularx environment, without errors.

test table

Now, I'm not sure why this is so, so if a more complete answer comes along, I will delete my answer. For now, I shall provide the quick solution for @Slovakov:


Specific solution:

\documentclass{report}
\usepackage[table]{xcolor}                  
\definecolor{steelblue}{RGB}{70,130,180}
\usepackage{tabularx}    
\usepackage[labelfont=bf,textfont=normal,justification=justified,singlelinecheck=false]{caption}    
\usepackage{ltablex}

\newcolumntype{Y}[1]{>{\setlength\hsize{#1\hsize}\centering\arraybackslash}X}
\begin{document}
    \begin{tabularx}{\textwidth}{Y{0.5}Y{0.15}Y{0.17}Y{0.08}Y{0.1}}  
            \caption{\small Sample caption.\label{tab:qfd}} \tabularnewline
\rowcolor{steelblue} \textcolor{white}{Quality Characteristics  ( Requirements)} & \textcolor{white}{Minimize, Maximize, or Target}  & \textcolor{white}{Max Relationship}  & \textcolor{white}{Requirement  Weight} & \textcolor{white}{Relative Weight}   \tabularnewline
Possibility of Automation                                             & maximize                                                                & 9                                                                  & 14,64               & 1,14\%                                  \tabularnewline
Curling                                                               & minimize                                                                & 1                                                                  & 1,50                & 0,12\%                                  \tabularnewline
Young's modulus                                                       & minimize                                                                & 3                                                                  & 10,26               & 0,80\%                                  \tabularnewline
Peel-off adhesion                                                     & maximize                                                                & 9                                                                  & 47,62               & 3,72\%                             \tabularnewline
Presence of characteristic feature                                    &target                                                               & 1                                                                  & 1,50                & 0,12\%                                  \tabularnewline
Substrate preparation time                                            & minimize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Number of steps                                                       & minimize                                                                & 3                                                                  & 5,13                & 0,40\%                                  \tabularnewline
time of application                                                   & minimize                                                                & 9                                                                  & 19,89               & 1,55\%                                  \tabularnewline
Film preparation time                                                 & minimize                                                                & 3                                                                  & 5,13                & 0,40\%                                  \tabularnewline
Equipment Cost                                                        & minimize                                                                & 3                                                                  & 4,50                & 0,35\%                                  \tabularnewline
Consumables cost per hour                                             & minimize                                                                & 9                                                                  & 13,51               & 1,05\%                                  \tabularnewline
Material cost per area                                                & minimize                                                                & 9                                                                  & 13,89               & 1,08\%                                  \tabularnewline
Wetting                                                               & minimize                                                                & 9                                                                  & 28,44               & 2,22\%                                  \tabularnewline
Maximum Heat Absorption                                               & minimize                                                                & 9                                                                  & 14,14               & 1,10\%                                  \tabularnewline
Stain resistance                                                      & maximize                                                                & 9                                                                  & 34,28               & 2,67\%                                  \tabularnewline
Surface texture                                                       &target                                                               & 9                                                                  & 85,20               & 6,65\%                                  \tabularnewline
Area of residue left                                                  & minimize                                                                & 9                                                                  & 16,51               & 1,29\%                                  \tabularnewline
Self-healing properties                                               &target                                                               & 9                                                                  & 22,27               & 1,74\%                                  \tabularnewline
Ability of repair with DIY paint repair kits (decorative only)        &target                                                               & 3                                                                  & 5,00                & 0,39\%                                  \tabularnewline
Polishing quality                                                     & maximize                                                                & 3                                                                  & 5,00                & 0,39\%                                  \tabularnewline
Scratch resistance                                                    & maximize                                                                & 9                                                                  & 34,15               & 2,66\%                                  \tabularnewline
Edge Roughness                                                        & minimize                                                                & 9                                                                  & 38,78               & 3,03\%                                  \tabularnewline
Presence of adhesive                                                  &target                                                               & 9                                                                  & 16,51               & 1,29\%                                  \tabularnewline
Cling adhesion                                                        &target                                                               & 3                                                                  & 7,51                & 0,59\%                                  \tabularnewline
Opacity                                                               & maximize                                                                & 9                                                                  & 15,80               & 1,23\%                                  \tabularnewline
Colour deviation                                                      & minimize                                                                & 9                                                                  & 76,19               & 5,94\%                                  \tabularnewline
Thickness                                                             & minimize                                                                & 9                                                                  & 29,98               & 2,34\%                                  \tabularnewline
Edge visibility                                                       & minimize                                                                & 9                                                                  & 22,77               & 1,78\%                                  \tabularnewline
Gloss                                                                 &target                                                               & 9                                                                  & 55,80               & 4,35\%                                  \tabularnewline
Transmittance of protective film                                      & maximize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Presence of bubbles                                                   &target                                                               & 9                                                                  & 18,02               & 1,41\%                                  \tabularnewline
Features supporting bubble-free application                           &target                                                               & 3                                                                  & 6,01                & 0,47\%                                  \tabularnewline
Orange peel look                                                      &target                                                             & 9                                                                  & 18,02               & 1,41\%                                  \tabularnewline
Variation in surface roughness                                        & minimize                                                                & 9                                                                  & 11,63               & 0,91\%                                  \tabularnewline
Rubbing wear resistance                                               & maximize                                                                & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Reactivity with chemical substances                                   &target                                                              & 9                                                                  & 39,41               & 3,07\%                                  \tabularnewline
Abrasion Resistance                                                   & maximize                                                                & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Nano-scratch resistance                                               & maximize                                                                & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Elongation                                                            &target                                                               & 9                                                                  & 23,52               & 1,83\%                                  \tabularnewline
Stone chipping resistance                                             & maximize                                                                & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Impact toughness                                                      & maximize                                                                & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Shear adhesion                                                        & maximize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Edge adhesion                                                         & maximize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Pressure adhesion                                                     & maximize                                                                & 3                                                                  & 5,13                & 0,40\%                                  \tabularnewline
Surface Energy                                                        & maximize                                                                & 9                                                                  & 18,39               & 1,43\%                                  \tabularnewline
Possibility to apply custom colour                                    &target                                                              & 9                                                                  & 14,64               & 1,14\%                                 \tabularnewline
Printability                                                          &target                                                               & 3                                                                  & 4,88                & 0,38\%                                  \tabularnewline
Possible to store in production area                                  &target                                                               & 9                                                                  & 12,39               & 0,97\%                                  \tabularnewline
Colour changing properties                                            &target                                                               & 9                                                                  & 9,76                & 0,76\%                                  \tabularnewline
Thermal conductivity                                                  &target                                                               & 9                                                                  & 14,39               & 1,12\%                                  \tabularnewline
Thermal expansion coefficient                                         &target                                                               & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Minimum operating temperature                                         &target                                                               & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Maximum operating temperature                                         &target                                                               & 9                                                                  & 20,52               & 1,60\%                                  \tabularnewline
Hardness                                                              & maximize                                                                & 3                                                                  & 5,13                & 0,40\%                                  \tabularnewline
Change in toughness per time                                          & minimize                                                                & 3                                                                  & 5,13                & 0,40\%                                  \tabularnewline
Gloss loss over time                                                  & minimize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Corrosion resistance                                                  & maximize                                                                & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Water absorption                                                      & maximize                                                                & 9                                                                  & 29,23               & 2,28\%                                  \tabularnewline
Air tightness                                                         & maximize                                                                & 3                                                                  & 5,75                & 0,45\%                                  \tabularnewline
Solubility in water                                                   &target                                                               & 9                                                                  & 15,39               & 1,20\%                                  \tabularnewline
Shrinkage                                                             & minimize                                                               & 9                                                                  & 17,26               & 1,35\%                                  \tabularnewline
Yellowing                                                             & minimize                                                                & 9                                                                  & 18,02               & 1,41\%                                  \tabularnewline
Presence of toxic substances                                          &target                                                               & 9                                                                  & 18,77               & 1,46\%                                  \tabularnewline
Toxicity after disposal                                               &target                                                               & 9                                                                  & 18,77               & 1,46\%                                  \tabularnewline
Flammability                                                          &target                                                               & 9                                                                  & 18,77               & 1,46\%                                  \tabularnewline
Percentage content of recyclable materials                            & maximize                                                                & 9                                                                  & 16,51               & 1,29\%                                  \tabularnewline
Presence of standard Toxic substances                                 &target                                                               & 9                                                                  & 16,89               & 1,32\%                                  \tabularnewline
Friction drag coefficient                                             & minimize                                                                & 9                                                                  & 9,38                & 0,73\%                                  \tabularnewline
Mass per area                                                         & minimize                                                                & 9                                                                  & 13,14               & 1,02\%                                  \tabularnewline
Usage of special or specific tools                                    &target                                                               & 3                                                                  & 3,50                & 0,27\%                                \tabularnewline \hline
\end{tabularx}
\end{document}

final

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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