gt icon indicating copy to clipboard operation
gt copied to clipboard

Have gt tables look okay in bookdown, blogdown, xaringan

Open rich-iannone opened this issue 4 years ago • 2 comments

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.

rich-iannone avatar Feb 19 '20 18:02 rich-iannone

{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.

brshallo avatar Mar 22 '21 19:03 brshallo

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

jthomasmock avatar Apr 26 '22 22:04 jthomasmock