2

It seems to be a common question, but the other werent adressing my code.

\begin{table}[ht!]
\centering
\small
\caption{Absolute and relative frequencies } 
\label{FreqFair}
\renewcommand{\arraystretch}{1}
\setlength{\tabcolsep}{1pt}
\scalebox{1}{
\begin{tabular}{p{0.2\textwidth}p{0.15\textwidth}p{0.15\textwidth}p{0.15\textwidth}p{0.15\textwidth}p{0.1\textwidth}} \\ \toprule%{L C R} 
& \multicolumn{5}{c}{Stated importance} \\ 
&Very\linebreak important&Important&Moderately\linebreak important&Not\linebreak     important&Total \\ \midrule
\end{tabular}
}
\normalsize
\end{table}

I guess using the line break in the first row is not the best idea, but then it looks exactly how I want it.

5
  • 1
    Hi, I think your question is the same one as Tabular: Underfull \hbox (badness 10000) in paragraph at lines. Please have a look whether it helps. If it helps, let us now and we will mark the questions as duplicates. If it doesn't help, please edit your question and indicate what problems exactly do you have.
    – yo'
    Dec 10, 2013 at 16:05
  • Please construct a compilable minimal working example (MWE) from \documentclass... until \end{document}.
    – masu
    Dec 10, 2013 at 16:05
  • 1
    That one help cause I used \newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}} as they suggested. I dont really get why, but I think you can just close it, thx for the help
    – Max M
    Dec 10, 2013 at 16:32
  • I don't think this is a duplicate, the problem here is using \linebreak instead of \newline for a manual break, the other question is about setting \raggedright and automatic line breaks. Dec 10, 2013 at 19:43
  • Ok but then again it seems to be answered. I used the newly defined column and keppt the \linebreak and the error was gone.
    – Max M
    Dec 11, 2013 at 13:42

1 Answer 1

5

If you replace the \linebreak macro calls with \newline-s, the bad boxes will go away. That's because the \linebreak command causes LaTeX to stretch the line so it extends to the right margin. And this can't be done by stretching the whitespaces only if you have one word...

Changing the alignment in the cells (eg. to \raggedright) could also remove the bad boxes.

(Thanks to @DavidCarlisle for pointing out how wrong I was.)

3
  • 6
    er no:-) \\ will end the table row. Right idea though, but you want \newline . Also flushleft is an environment, \raggedright is the command form. Dec 10, 2013 at 16:21
  • @DavidCarlisle errrrh errrrhhhh Aye Captain...:-)
    – azetina
    Dec 10, 2013 at 16:24
  • @DavidCarlisle fixed, thank you, and sorry for the bad reading
    – masu
    Dec 10, 2013 at 17:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .