huxtable (version 1.2.0)

left_border_color: Border colors

Description

Functions to get or set the border colors property of huxtable table cells.

Usage

left_border_color(ht)
left_border_color(ht) <- value
set_left_border_color(ht, row, col, value, byrow = FALSE)

right_border_color(ht) right_border_color(ht) <- value set_right_border_color(ht, row, col, value, byrow = FALSE)

top_border_color(ht) top_border_color(ht) <- value set_top_border_color(ht, row, col, value, byrow = FALSE)

bottom_border_color(ht) bottom_border_color(ht) <- value set_bottom_border_color(ht, row, col, value, byrow = FALSE)

Arguments

ht

A huxtable.

value

A vector or matrix of colors. Set to NA for the default. Set to NA to reset to the default.

row

A row specifier. See rowspecs for details.

col

An optional column specifier.

byrow

If TRUE, fill in values by row rather than by column.

Value

For left_border_color, the left_border_color attribute. For set_left_border_color, the ht object.

Similarly for the other functions.

Details

Both LaTeX and HTML collapse borders. If results are not what you expected, try setting the adjoining border of the previous cell to width 0 (e.g. for a left border color, unset the right border of the cell on the left).

See Also

set_all_border_colors

Examples

Run this code
# NOT RUN {
ht <- huxtable(a = 1:3, b = 1:3)
left_border_color(ht) <-  'red'
left_border_color(ht)


ht <- huxtable(a = 1:3, b = 3:1)
ht2 <- set_left_border_color(ht, 'red')
left_border_color(ht2)
ht3 <- set_left_border_color(ht, 1:2, 1, 'red')
left_border_color(ht3)
ht4 <- set_left_border_color(ht, 1:2, 1:2, c('red', 'blue'), byrow = TRUE)
left_border_color(ht4)
ht5 <- set_left_border_color(ht, where(ht == 1), 'red')
left_border_color(ht5)
# }

Run the code above in your browser using DataCamp Workspace