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

Have gt tables look okay in bookdown, blogdown, xaringan #492

Open
rich-iannone opened this issue Feb 19, 2020 · 2 comments
Open

Have gt tables look okay in bookdown, blogdown, xaringan #492

rich-iannone opened this issue Feb 19, 2020 · 2 comments

Comments

@rich-iannone
Copy link
Member

In bookdown, blogdown, pkgdown, and xaringan (and others) there are CSS rules that directly affect elements such as <table>, <th>, <tr>, etc., leading to unexpected results when integrating a gt table in any documents/pages.

The solution is to implement a simple CSS reset at the table level. Once that's done, perform integration tests on all of these.

@brshallo
Copy link

brshallo commented Mar 22, 2021

{gt} seems to substantially increase the .ReadingTime variable as calculated by hugo.

I went through and changed a post from using knitr::kable() to using gt::gt() on several tables in a post and found my article's read time had substantially increased as a result. My guess is this has to do with the way gt adds css to the page... but unsure.

The specific article where I noticed this can be found here. (Wasn't sure was worth opening a new issue etc. as seems related to other things...)

Side note:

I turned off displaying .ReadingTime on longer posts via:

    {{ if and (eq .Section "post") (lt .ReadingTime 17)}} 
    <span class="article-duration">{{ .ReadingTime }} min read</span>
    {{ end }}

In single.html.

@rich-iannone rich-iannone modified the milestones: v0.3.1, v0.4.0 Jun 21, 2021
@rich-iannone rich-iannone modified the milestones: v0.4.0, v0.5.0 Jan 26, 2022
@rich-iannone rich-iannone modified the milestones: v0.5.0, v0.6.0 Mar 1, 2022
@rich-iannone rich-iannone modified the milestones: v0.6.0, v0.7.0 Apr 19, 2022
@jthomasmock
Copy link
Collaborator

Just wanted to drop in and add Quarto to the list of above formats 😉

@rich-iannone rich-iannone modified the milestones: v0.7.0, v0.8.0 Aug 11, 2022
@rich-iannone rich-iannone modified the milestones: v0.8.0, FUTURE Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants