diff options
| -rw-r--r-- | examples/chronicles-example.adoc | 2 | ||||
| -rw-r--r-- | examples/chronicles-example.pdf | bin | 193877 -> 193922 bytes | |||
| -rw-r--r-- | lib/asciidoctor-pdf/converter.rb | 9 |
3 files changed, 8 insertions, 3 deletions
diff --git a/examples/chronicles-example.adoc b/examples/chronicles-example.adoc index dc59a0fe..c373786b 100644 --- a/examples/chronicles-example.adoc +++ b/examples/chronicles-example.adoc @@ -465,7 +465,7 @@ Here's some content inside an open block. == Credits .Brought to you by OpenDevise -[%header%footer,cols="1,1s,1",grid=rows,frame=topbot] +[%header%footer,cols="1,1s,1",grid=rows,frame=topbot,width=70%] |=== |Name |Title diff --git a/examples/chronicles-example.pdf b/examples/chronicles-example.pdf Binary files differindex 12bd0342..156df945 100644 --- a/examples/chronicles-example.pdf +++ b/examples/chronicles-example.pdf diff --git a/lib/asciidoctor-pdf/converter.rb b/lib/asciidoctor-pdf/converter.rb index 7db6d0b3..942f1e3d 100644 --- a/lib/asciidoctor-pdf/converter.rb +++ b/lib/asciidoctor-pdf/converter.rb @@ -1181,8 +1181,6 @@ class Converter < ::Prawn::Document table_data << row_data end - column_widths = node.columns.map {|col| ((col.attr 'colpcwidth') * bounds.width) / 100.0 } - border = {} table_border_width = theme.table_border_width [:top, :bottom, :left, :right, :cols, :rows].each {|edge| border[edge] = table_border_width } @@ -1208,6 +1206,13 @@ class Converter < ::Prawn::Document border[:top] = border[:right] = border[:bottom] = border[:left] = 0 end + if node.option? 'autowidth' + column_widths = [] + else + table_width = bounds.width * ((node.attr 'tablepcwidth') / 100.0) + column_widths = node.columns.map {|col| ((col.attr 'colpcwidth') * table_width) / 100.0 } + end + table_settings = { header: table_header, cell_style: { |
