huxtable (version 0.2.1)

col_width: Column widths

Description

Functions to get or set the column widths property of huxtable cols.

Usage

col_width(ht)
col_width(ht) <- value
set_col_width(ht, col, value)

Arguments

ht
A huxtable.
value
A vector. If numeric, they are treated as proportions of the table width. If character, they must be valid CSS or LaTeX lengths.
col
A col specifier. See rowspecs for details.

Value

For col_width, the col_width attribute. For set_col_width, the ht object.

Details

In LaTeX, if you specify a column width, but set `wrap` to `FALSE` and have cells which overrun, then you may have problems with table position and with background colours in other cells. The workaround is to adjust the width, so that your cells no longer overrun.

See Also

Other row/column heights: row_height

Examples

Run this code

ht <- huxtable(a = 1:3, b = 1:3)
col_width(ht) <-  c(.2, .8)
col_width(ht)
print_screen(ht)

Run the code above in your browser using DataCamp Workspace