R: Set left, right, top and bottom properties

set-multiple {huxtable} | R Documentation

## 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.

### 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.

### Value

The modified huxtable.

### Examples

    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)

[Package huxtable version 4.2.0 Index]