From f7bbfc038e0294203146aa0ac12d52fb68306f1e Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Sat, 26 Feb 2011 19:50:11 -0500 Subject: [PATCH] show tables with percentage widths --- bin/rtf_parse | 4 ++-- lib/ruby-rtf/table.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/rtf_parse b/bin/rtf_parse index 97699b2..37b2ea1 100755 --- a/bin/rtf_parse +++ b/bin/rtf_parse @@ -86,11 +86,11 @@ doc.sections.each do |section| mods = section[:modifiers] if mods[:table] - str << "\n" + str << "
\n" mods[:table].rows.each do |row| str << "\n" row.cells.each do |cell| - str << "
\n" + str << "\n" cell.sections.each do |sect| format(str, sect) end diff --git a/lib/ruby-rtf/table.rb b/lib/ruby-rtf/table.rb index bbd6282..713f8eb 100644 --- a/lib/ruby-rtf/table.rb +++ b/lib/ruby-rtf/table.rb @@ -64,7 +64,7 @@ def width end_pos = row.end_positions[idx] prev_pos = idx == 0 ? 0 : row.end_positions[idx - 1] - end_pos - prev_pos - (2 * gap) - left_margin + ((end_pos - prev_pos - (2 * gap) - left_margin) / row.end_positions[-1]) * 100 end end end