I used the code in the end of this question to plot and save a gt
table. Now I am facing a problem that the top, bottom, left and right edges of the table are too compact (the space is too small). In my actual data plotted table, the last column is even out the area of the table.
Thus I want to add more margin space (increase the area between the two blue boxes as figure below shows) to the four edges of the table.
How can I achieve this? Maybe I'm missing some parameters, but I didn't find the right ones in tab_options()
. Thanks.
library(gt)
p <- mtcars %>%
select(cyl:wt) %>%
head() %>%
gt()
gtsave(p, file='test.png', vwidth=1000, vheight=600, zoom=1)
Out: