R gt_table adjust row height

Viewed 1346

I am outputting a table using gt_table. An example of my output is here: https://i.imgur.com/9HPEQzD.png

I need to decrease the "padding" or "white space" around the row height so that the final output is as concise as I can make it. I have looked through the gt_table documentation and have not been able to find a way to adjust the row heights. Specifically I have looked at the tab_style and tab_option keywords, but couldn't make any of the keywords work.

Any help would be much appreciated!

Thanks!

1 Answers

This can be done with the data_row.padding parameter in tab_options.

library(gt)

gt(head(iris)) %>%
  tab_options(data_row.padding = px(1))

Plot

Related