R: Cell padding

left_padding {huxtable} | R Documentation

## Cell padding

### Description

Functions to get or set the cell padding property of huxtable cells.

### Usage

    left_padding(ht)
    left_padding(ht) <- value
    set_left_padding(ht, row, col, value, byrow = FALSE)

    right_padding(ht)
    right_padding(ht) <- value
    set_right_padding(ht, row, col, value, byrow = FALSE)

    bottom_padding(ht)
    bottom_padding(ht) <- value
    set_bottom_padding(ht, row, col, value, byrow = FALSE)

    top_padding(ht)
    top_padding(ht) <- value
    set_top_padding(ht, row, col, value, byrow = FALSE)

### Arguments

`ht` | A huxtable.
`value` | A vector or matrix. Characters must be valid CSS or LaTeX lengths. Numbers will be interpreted as lengths in points. Set to `NA` to reset to the default, which is `4`.
`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_padding`, the `left_padding` property. For `set_left_padding`, the `ht` object.

Similarly for the other functions.

### Examples

    ht <- huxtable(a = 1:3, b = 1:3)
    left_padding(ht) <-  20
    left_padding(ht)

    ht <- huxtable(a = 1:3, b = 3:1)
    ht2 <- set_left_padding(ht, 20)
    left_padding(ht2)
    ht3 <- set_left_padding(ht, 1:2, 1, 20)
    left_padding(ht3)
    ht4 <- set_left_padding(ht, 1:2, 1:2, c(20, 10), byrow = TRUE)
    left_padding(ht4)
    ht5 <- set_left_padding(ht, where(ht == 1), 20)
    left_padding(ht5)

[Package huxtable version 4.2.0 Index]