Skip to content

Commit

Permalink
Updated code example in README: fixed typo, adjusted column widths.
Browse files Browse the repository at this point in the history
  • Loading branch information
maximkulkin committed Nov 9, 2009
1 parent 3ac5d96 commit a012002
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions README
Expand Up @@ -6,7 +6,7 @@ Library to generate OpenDocument Spreadsheet documents.
Example
=======

sheet = Spreadhseet::Builder.new
sheet = Spreadsheet::Builder.new
sheet.spreadsheet do
sheet.table 'Time report (simple)' do
sheet.row {
Expand All @@ -18,22 +18,21 @@ Example
sheet.cell 2.0
}
end

sheet.table 'Time report (rich)' do
sheet.column :width => '8in'
sheet.column :width => '2in'
sheet.column :width => '4in'
sheet.column :width => '0.5in'

sheet.header {
sheet.row {
sheet.cell 'Time report', :span => 2, :class => 'title'
sheet.cell 'Time report', :span => 2, :style => 'title'
}
sheet.row # empty row
sheet.row {
sheet.cell 'Activity', :align => :left
sheet.cell 'Hours'
}
}

sheet.row {
sheet.string_cell 'Developing spreadsheet library'
sheet.numeric_cell 80.0
Expand All @@ -44,7 +43,7 @@ Example
}
end
end

File.open('time_report.ods', 'wb') { |f| f.write sheet.content! }


Expand Down

0 comments on commit a012002

Please sign in to comment.