left_padding

0th

Percentile

Cell padding

Functions to get or set the cell padding property of huxtable table 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)

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

Arguments
ht

A huxtable.

row

A row specifier. See rowspecs for details.

col

An optional column specifier.

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.

byrow

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

Details

set_all_padding is a convenience function which sets left, right, top and bottom cell padding for the specified cells.

Value

For left_padding, the left_padding attribute. For set_left_padding, the ht object.

Similarly for the other functions.

Aliases
  • left_padding
  • left_padding<-
  • set_left_padding
  • left_padding.huxtable
  • left_padding<-.huxtable
  • right_padding
  • top_padding
  • bottom_padding
  • right_padding<-
  • top_padding<-
  • bottom_padding<-
  • right_padding.huxtable
  • top_padding.huxtable
  • bottom_padding.huxtable
  • right_padding<-.huxtable
  • top_padding<-.huxtable
  • bottom_padding<-.huxtable
  • set_right_padding
  • set_top_padding
  • set_bottom_padding
  • right_padding
  • bottom_padding
  • top_padding
  • set_all_padding
Examples
# NOT RUN {
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)
ht <- huxtable(a = 1:3, b = 1:3)
ht <- set_all_padding(ht, 1:3, 1:2, "20px")
left_padding(ht)
right_padding(ht)
# }
Documentation reproduced from package huxtable, version 1.2.0, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.