summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2015-09-05 17:51:11 -0600
committerDan Allen <dan.j.allen@gmail.com>2015-09-05 17:51:11 -0600
commit75b62cdc040eb89c6dcf697d73f53bc61405f39f (patch)
tree7ede91ba19e9ce0f4e195cdb61392cb34079cc9a /lib
parent6675565a20828913785b8cc5e1d169ea09ea4d5e (diff)
resolves #314 handle case when colpcwidth is unspecified
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor-pdf/converter.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/asciidoctor-pdf/converter.rb b/lib/asciidoctor-pdf/converter.rb
index 092cef17..b6002845 100644
--- a/lib/asciidoctor-pdf/converter.rb
+++ b/lib/asciidoctor-pdf/converter.rb
@@ -1220,7 +1220,8 @@ class Converter < ::Prawn::Document
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 }
+ even_column_pct = 100.0 / node.columns.size
+ column_widths = node.columns.map {|col| ((col.attr 'colpcwidth', even_column_pct) * table_width) / 100.0 }
end
if ((position = node.attr 'align') && (AlignmentNames.include? position)) ||