Skip to content

Commit

Permalink
Document new column_widths method
Browse files Browse the repository at this point in the history
  • Loading branch information
goulvench committed Mar 18, 2020
1 parent 438adc8 commit c41ddfe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ the simplest solution to both problems.*
Release v1.4.0 deprecated the behaviour of automatically adding an empty paragraph tag after every table. If you are upgrading from an older version of the library, you will need to control such spacing in your own code.
```

Tables can be added using the `table` method. The method accepts several optional paramters to control the layout and style of the table cells.
Tables can be added using the `table` method. The method accepts several optional parameters to control the layout and style of the table cells.

The `table` command accepts data in the form of a two-dimensional arrays. This corresponds to rows and column cells within those rows. Each array item can be a string, a Hash of options, a Proc (which will be passed as a block), or a `TableCellModel`. The command will normalize all array contents into a two-dimensional array of `TableCellModel` instances.

Expand All @@ -642,6 +642,7 @@ docx.table [['Header 1','Header 2'],['Cell 1', 'Cell 2']] do
border_line :single # sets the border style. defaults to :single. see OOXML docs for details.
border_size 4 # sets the border width. defaults to 0. units in twips.
border_spacing 4 # sets the spacing around the border. defaults to 0. units in twips.
column_widths [80, 120] # sets the column widths. defaults to auto. units in twips.
end
```

Expand Down

0 comments on commit c41ddfe

Please sign in to comment.