huxtable (version 0.2.1)

left_border: Borders

Description

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

Usage

left_border(ht)
left_border(ht) <- value
set_left_border(ht, row, col, value, byrow = FALSE)

right_border(ht) right_border(ht) <- value set_right_border(ht, row, col, value, byrow = FALSE)

top_border(ht) top_border(ht) <- value set_top_border(ht, row, col, value, byrow = FALSE)

bottom_border(ht) bottom_border(ht) <- value set_bottom_border(ht, row, col, value, byrow = FALSE)

Arguments

ht
A huxtable.
value
A numeric vector or matrix giving border widths. Set to 0 for no border. 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, the left_border attribute. For set_left_border, the ht object. Similarly for the other functions.

See Also

set_all_borders

Examples

Run this code

ht <- huxtable(a = 1:3, b = 1:3)
left_border(ht) <-  1
left_border(ht)
print_screen(ht)

ht <- huxtable(a = 1:3, b = 3:1)
ht2 <- set_left_border(ht, 1)
left_border(ht2)
ht3 <- set_left_border(ht, 1:2, 1, 1)
left_border(ht3)
ht4 <- set_left_border(ht, 1:2, 1:2, c(1, 2), byrow = TRUE)
left_border(ht4)
ht5 <- set_left_border(ht, where(ht == 1), 1)
left_border(ht5)

Run the code above in your browser using DataCamp Workspace