From c41ddfe3f8e71e3953cbaf95e94c274db830a15b Mon Sep 17 00:00:00 2001 From: Goulven Champenois Date: Wed, 18 Mar 2020 16:45:37 +0100 Subject: [PATCH] Document new `column_widths` method --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 56f19204..4c7daa7c 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 ```