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

Unable to display table in html_notebook #170

Closed
JasonAizkalns opened this issue Feb 7, 2019 · 5 comments
Closed

Unable to display table in html_notebook #170

JasonAizkalns opened this issue Feb 7, 2019 · 5 comments

Comments

@JasonAizkalns
Copy link

When using output: html_notebook in an .Rmd file, I am unable to display the output of a gt() object. It only renders in the preview pane/viewer within RStudio. For example:

---
title: "R Notebook"
output: html_notebook
---

```{r echo=FALSE}
library(gt)
mtcars %>% gt()
```

Will not render anything.

However, a plain-vanilla html_document does just fine as the following works as expected:

---
title: "R Notebook"
output:
  html_document:
    df_print: paged
---

```{r echo=FALSE}
library(gt)
mtcars %>% gt()
```

I am not sure if this is an issue with rmarkdown or there is something missing in gt? Note: I have tried setting options such as results='asis' and/or appending %>% as_raw_html() without success.

@rich-iannone
Copy link
Member

Thanks for reporting this! I admit that html_notebook has been a blind spot (as it wasn't yet tested). We'll have a closer look at this bug soon.

@MokeEire
Copy link

I am using gt in an RNotebook and not experiencing this issue.

The table has no margin between it and the markdown text which follows it, but that is a separate issue which I'm searching for at the moment.

@nriley
Copy link

nriley commented May 20, 2020

@MokeEire — it's not a great solution but you can add <br> after your gt.

@MokeEire
Copy link

@nriley thank you, that's exactly what I've been doing in the meantime.

@rich-iannone rich-iannone added this to the FUTURE milestone Aug 22, 2022
@rich-iannone
Copy link
Member

As there's no way to detect the RNotebook environment (and a workaround exists) I am going to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants