These functions set border colors.

left_border_color(ht)
left_border_color(ht) <- value
set_left_border_color(ht, row, col, value )
map_left_border_color(ht, row, col, fn)

right_border_color(ht)
right_border_color(ht) <- value
set_right_border_color(ht, row, col, value )
map_right_border_color(ht, row, col, fn)

top_border_color(ht)
top_border_color(ht) <- value
set_top_border_color(ht, row, col, value )
map_top_border_color(ht, row, col, fn)

bottom_border_color(ht)
bottom_border_color(ht) <- value
set_bottom_border_color(ht, row, col, value )
map_bottom_border_color(ht, row, col, fn)

Arguments

ht

A huxtable.

row

A row specifier. See rowspecs for details.

col

An optional column specifier.

fn

A mapping function. See mapping-functions for details.

value

A valid R color, e.g. "red", "#FF0000".

Details

Borders are always "collapsed": right_border_color(ht)[, 1] is the same as left_border_color(ht)[, 2], and setting one sets the other.

Limitations

  • Transparent borders with the alpha channel set are not guaranteed to work.

See also

set-multiple, brdr()

Other border properties: border-styles, borders

Examples

jams <- set_all_borders(jams) bottom_border_color(jams)[1, ] <- "red" jams
#> ┌────────────┬───────┬───────────────┐ #> │ Type │ Price │ Sugar content │ #> ├────────────┼───────┼───────────────┤ #> │ Strawberry │ 1.90 │ 40.00% │ #> ├────────────┼───────┼───────────────┤ #> │ Raspberry │ 2.10 │ 35.00% │ #> ├────────────┼───────┼───────────────┤ #> │ Plum │ 1.80 │ 50.00% │ #> └────────────┴───────┴───────────────┘ #> #> Column names: Type, Price, Sugar
set_bottom_border_color(jams, "blue")
#> ┌────────────┬───────┬───────────────┐ #> │ Type │ Price │ Sugar content │ #> ├────────────┼───────┼───────────────┤ #> │ Strawberry │ 1.90 │ 40.00% │ #> ├────────────┼───────┼───────────────┤ #> │ Raspberry │ 2.10 │ 35.00% │ #> ├────────────┼───────┼───────────────┤ #> │ Plum │ 1.80 │ 50.00% │ #> └────────────┴───────┴───────────────┘ #> #> Column names: Type, Price, Sugar