lib/reports/ReportTable.rb in taskjuggler-0.0.2 vs lib/reports/ReportTable.rb in taskjuggler-0.0.3

- old
+ new

@@ -19,10 +19,14 @@ # generators for all the table reports create the report in this intermediate # format. The to_* member functions can then output the table in the # appropriate format. class ReportTable + # The height in pixels of a horizontal scrollbar on an HTML page. This + # value should be large enough to work for all browsers. + SCROLLBARHEIGHT = 20 + attr_reader :maxIndent, :headerLineHeight, :headerFontSize attr_accessor :equiLines # Create a new ReportTable object. def initialize @@ -91,12 +95,13 @@ # Generate the rest of the table. @lines.each { |line| tbody << line.to_html } # In case we have columns with scrollbars, we generate an extra line with # cells for all columns that don't have a scrollbar. The scrollbar must - # have a height of 18 pixels or less. + # have a height of SCROLLBARHEIGHT pixels or less. if hasScrollbar? - tbody << (tr = XMLElement.new('tr', 'style' => 'height:18px')) + tbody << (tr = XMLElement.new('tr', + 'style' => "height:#{SCROLLBARHEIGHT}px")) @columns.each do |column| unless column.scrollbar tr << XMLElement.new('td') end end