diff --git a/pdf/creator/table.go b/pdf/creator/table.go index 16c4d56c..0de7028b 100644 --- a/pdf/creator/table.go +++ b/pdf/creator/table.go @@ -590,7 +590,7 @@ func (cell *TableCell) Width(ctx DrawContext) float64 { } // SetContent sets the cell's content. The content is a VectorDrawable, i.e. a Drawable with a known height and width. -// The currently supported VectorDrawable is: *Paragraph. +// The currently supported VectorDrawable is: *Paragraph, *StyledParagraph. func (cell *TableCell) SetContent(vd VectorDrawable) error { switch t := vd.(type) { case *Paragraph: @@ -599,6 +599,13 @@ func (cell *TableCell) SetContent(vd VectorDrawable) error { t.enableWrap = false // No wrapping. } + cell.content = vd + case *StyledParagraph: + if t.defaultWrap { + // Default styled paragraph settings in table: no wrapping. + t.enableWrap = false // No wrapping. + } + cell.content = vd case *Image: cell.content = vd