Learn R Programming

huxtable (version 4.2.1)

set-multiple: Set left, right, top and bottom properties

Description

These are convenience functions which set left, right, top and bottom properties simultaneously for the specified cells.

Usage

set_all_borders(ht, row, col, value, byrow = FALSE)

set_all_border_colors(ht, row, col, value, byrow = FALSE)

set_all_border_styles(ht, row, col, value, byrow = FALSE)

set_all_padding(ht, row, col, value, byrow = FALSE)

set_outer_borders(ht, row, col, value)

Arguments

ht

A huxtable.

row

A row specifier. See rowspecs for details.

col

An optional column specifier.

value

Value(s) to set. Set to NA to reset to the default.

byrow

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

Value

The modified huxtable.

Details

set_outer_borders sets borders round the top, bottom, left and right of a group of cells. Behaviour is undefined unless row and col specify contiguous sequences.

Examples

Run this code
# NOT RUN {
ht <- huxtable(a = 1:3, b = 1:3)
set_all_borders(ht, 1:3, 1:2, 1)
ht <- set_all_border_colors(ht, 'red')
ht <- set_all_border_styles(ht, 'double')
ht <- set_all_padding(ht, 1:3, 1:2, "20px")
ht2 <- huxtable(a = 1:3, b = 1:3)
set_outer_borders(ht2, 1)
set_outer_borders(ht2, 2:3, 1:2, 1)

# Problems with colspan:
rowspan(ht2)[2, 1] <- 2
set_outer_borders(ht2, 1:2, 1:2, 1)

# }

Run the code above in your browser using DataLab