Manual specifications of column widths can be performed using the
cols_width() function. We choose which columns get specific widths (in
pixels, usually by use of the px() helper function). Width assignments are
supplied in ... through two-sided formulas, where the left-hand side
defines the target columns and the right-hand side is a single width value in
pixels.
cols_width(data, ..., .list = list2(...))
| data | A table object that is created using the |
|---|---|
| ... | Expressions for the assignment of column widths for the table
columns in |
| .list | Allows for the use of a list as an input alternative to |
An object of class gt_tbl.
Normally, column widths are automatically set to span across the width of the
container (both table and container widths can be individually modified with
the table.width and container.width options within tab_options()). When
using cols_width() though, the table.width option is disregarded in
favor of the pixel values set for each column.

4-2
Other Modify Columns:
cols_align(),
cols_hide(),
cols_label(),
cols_merge_range(),
cols_merge_uncert(),
cols_merge(),
cols_move_to_end(),
cols_move_to_start(),
cols_move()
# Use `exibble` to create a gt table; # with named arguments in `...`, we # can specify the exact widths for # table columns (using `everything()` # or `TRUE` at the end will capture # all remaining columns) tab_1 <- exibble %>% dplyr::select( num, char, date, datetime, row ) %>% gt() %>% cols_width( vars(num) ~ px(150), ends_with("r") ~ px(100), starts_with("date") ~ px(200), everything() ~ px(60) )