Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table margin bottom too small in RNotebook #590

Closed
MokeEire opened this issue May 20, 2020 · 3 comments · Fixed by #1116
Closed

Table margin bottom too small in RNotebook #590

MokeEire opened this issue May 20, 2020 · 3 comments · Fixed by #1116

Comments

@MokeEire
Copy link

The bottom margin between a gt() table in an RNotebook chunk (with no specified chunk options) and markdown text which follows it is too small.

mtcars %>% 
  rownames_to_column() %>% 
  mutate(hp_per_us_ton = hp/(2*wt)) %>% 
  arrange(-hp_per_us_ton) %>% 
  select(rowname, mpg, hp, wt, hp_per_us_ton) %>% 
  head(10) %>% 
  gt()

Looks like this:

rmarkdown issue

@rich-iannone
Copy link
Member

I was reminded of this recently and I think it definitely does not look good at all. Also, occurs in RMarkdown documents (and probably in other contexts too).

@MokeEire
Copy link
Author

The following addition to a CSS file solved it for me:

.gt_table {
    margin-bottom: 20px;
    margin-top: 20px;
}

@qdread
Copy link

qdread commented Mar 3, 2022

The CSS solution was helpful for me also in the context of print()ing a large number of gt tables in a loop within a code chunk, to put padding between them.

@rich-iannone rich-iannone added this to the FUTURE milestone Aug 22, 2022
@rich-iannone rich-iannone modified the milestones: FUTURE, v0.8.0 Nov 10, 2022
@rich-iannone rich-iannone moved this from Backlog to Todo In Progress in R Markdown Team Projects Nov 10, 2022
Repository owner moved this from Todo In Progress to Done in R Markdown Team Projects Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants