[Tex/LaTex] tabularx: underfull \hbox (badness 10000) in alignment

badnesstabularxwarnings

I'd like to have table of 15cm with fixed-width cells. I use tabularx package. For some reason, the following code gives underfull \hbox (badness 10000) in alignment . What causes this warning? How can I fix this?

\documentclass[a4paper,12pt]{report}

\usepackage[polish]{babel}

\usepackage[top=25mm,bottom=25mm,left=35mm,right=25mm]{geometry}
\usepackage{tabularx}

\begin{document}

\begin{table}[!ht]
\begin{tabularx}{150mm}{|>{\hsize=0.3\hsize}X|>{\hsize=0.6\hsize}X|>{\hsize=1\hsize}X|>{\hsize=1.55\hsize}X|>{\hsize=1\hsize}X|>{\hsize=1.55\hsize}X|}
\hline
a & b & c & d & e & f \tabularnewline
\hline
\end{tabularx}
\end{table}

\end{document}

Best Answer

I really wouldn't use tabularx here, as you really know all the column widths in advance, however if you do use it you can add some stretch glue to pad out the box

\documentclass[a4paper,12pt]{report}

\usepackage[polish]{babel}

\usepackage[top=25mm,bottom=25mm,left=35mm,right=25mm]{geometry}
\usepackage{tabularx}

\begin{document}

\begin{table}[!ht]
\begin{tabularx}{150mm}{!{\extracolsep{\fill}}|>{\hsize=0.3\hsize}X|>{\hsize=0.6\hsize}X|>{\hsize=1\hsize}X|>{\hsize=1.55\hsize}X|>{\hsize=1\hsize}X|>{\hsize=1.55\hsize}X|}
\hline
a & b & c & d & e & f \tabularnewline
\hline
\end{tabularx}
\end{table}

\hbox to 150mm{\hbox to 149.99mm{}}


\end{document}

The problem is that if a box is a fraction overfull TeX will not report it (if it is less than \hfuzz) but an underful box with no stretchable glue is always infinitely bad, as shown by the \hbox example at the end of the above.

Related Question