# Tag Info

## New answers tagged wrap

3

Another solution with plain c column types, thanks to the makecell package, which allows for line breaks and a common formatting of column heads. I also replaced the use of \arraystretch=1.5 with loading the cellspace package, so as to ensure a minimal vertical spacing at the top and bottom of cells in columns prefixed with the letter S. If you want column ...

4

Your table setup is a bit complicated. Rather than define a multitude of separate column types which actually just act on the p column type, it may be more straightforward to load the ragged2e package and set up the following definition: \newcolumntype{C}[1]{>{\Centering\arraybackslash}p{#1}} (The point of using \Centering instead of \centering is that ...

5

You may want to use \textbf{Long heading which I want to wrap} instead of \multicolumn{1}{c}{\textbf{Long heading which I want to wrap}} otherwise it results in a non-fixed column, where the text can't wrap. No need for others \multicolumns, either. Also 2.5cm is not enough, changed to 3cm in every column. MWE \documentclass[a4paper]{book} % ...

3

You have use \multicolumn to replace the p (parbox) specification for that cell by c which is a single line cell (like \mbox). You do not want to get rid of the parbox so don't use \multicolumn just use \centering In the last column you will need \centering\arraybackslash as otherwise the following \\ will just make a centred linebreak within the cell not ...

1

Another solution by declaring two new colummn types: \newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}} and \newcolumntype{R}[1]{>{\raggedleft\arraybackslash}m{#1}}. You can manually adjust the width by C{width} and R{width}. MWE \documentclass[a4paper]{article} \usepackage{tabularx} \newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}} ...

1

Try the tabu package. \documentclass[a4paper]{article} \usepackage{tabu} \begin{document} \begin {table}[h] \centering \tabulinesep = 3pt \begin{tabu}to \linewidth{X[1, r, m]*2{X[1, c, m]}} A long title that is wrapped on several lines & A long title that is wrapped on several lines & A long title that is wrapped on several lines \\ \hline A random ...

Top 50 recent answers are included