Closed mojavelinux closed 5 years ago
Consider the following AsciiDoc:
[%header%autowidth]
|===
|Operation |Operator
|multiply
|*
|divide
|/
|add
|+
|subtract
|-
|===
Here's how it is rendered:
This problem has been resolved prawn-table and the fix will be available in the next release of that library (perhaps 0.2.3). If it's released before alpha.14, I'll upgrade the version in the gemspec. If not, I'll loosen the version range to ~> 0.2.2
so the release gets picked up once available.
As described in the linked issue, the problem was the the width calculation was not being performed on the formatted (i.e., bold) text. Therefore, the calculation was off by enough to cause the content in the head cell to not fix on the line.
Until a new prawn-table release, possible workarounds for this problem include:
table_head_font_style: normal
in your theme,autowidth
option for the affected tables, andAnother way to solve this problem is to add the following to your Gemfile:
gem 'prawn-table', github: 'prawnpdf/prawn-table'
Since this is solved by upgrading prawn-table, and it's possible to use the development version of prawn-table with Asciidoctor PDF, I'm going to mark this as closed (with workaround).
It's no longer necessary to use the unreleased version of prawn-table with Asciidoctor PDF. Please use the latest release of prawn-table from rubygems.org. That's the only version that is tested with Asciidoctor PDF.
The content in the table head cell (i.e. the cell in the table head row) isn't considered when determining the (automatic) width of the column. As a result, if the content in this cell needs more space than the body cells in the same column, the content in the head cell gets hard wrapped by char.