Skip to content

Add more margin space to the top, bottom, left, and right edges of the gt table #1105

@ahbon123

Description

@ahbon123

Hello,

I used the code below 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).

library(gt)
p <- mtcars %>% 
  select(cyl:wt) %>% 
  head() %>% 
  gt()

gtsave(p, file='test.png', vwidth=1000, vheight=600, zoom=1)

Out:

image

Thus I want to add more margin space (increase the area between the two blue boxes as figure above 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions