Skip to main content

The PreTeXt Guide

Subsection 4.18.8 Multi-line Cells

A cell of a table may contain more text that fits onto one line. If you know exactly where you want the line-breaks to be, then structure the entire cell as a sequence of <line> elements.
Or, if you want the contents of a cell to look and feel more like a paragraph (or several), structure the cell as a sequence of <p>, which can contain the usual content of a <p>, excepting “larger” content such as display mathematics or lists. Now, in this case, you must constrain the width of the cell’s column, to force the line-breaking necessary to render a paragraph as several lines. Use the relevant <col/> element, and specify a percentage of the tabular’s overall width, like this:
<col width="40%"/>
A paragraph cell can be right-justified with the @halign attribute set to justify. But be aware that if the column is skinny, this can lead to awkward inter-word spaces.