6

I like the gitbook style in general, but some tables (particularly regression tables) look awful on it. How do I make specific tables in my document (not all of them) render as per the default bootstrap style?

I suspect this can be done by defining a custom css class and then modifying the function that creates the regression table to include that custom class, but I'd like to know if there's a more elegant or simpler way.

If I use bookdown::gitbook to render my Rmd file, it looks like the one on the left, which just looks broken. If I use bookdown::html_document2 or bookdown::html_book, it looks like the one on the right, which is what I want. I prefer how gitbook renders everything else though.

Left: Gitbook | Right: Boostrap

jiewpeng
  • 333
  • 2
  • 8
  • I agree the tables do not look pretty. I'd at least remove the vertical lines by `.book .book-body .page-wrapper .page-inner section.normal table td, .book .book-body .page-wrapper .page-inner section.normal table th { border-left: none; border-right: none; }` in CSS. – Yihui Xie Sep 10 '16 at 03:59
  • Personally I think the extra spacing between sections of the regression table are more annoying. Removing the vertical lines helps a bit but the table still looks ugly. – jiewpeng Sep 11 '16 at 09:55
  • Is there any new development in this regard @YihuiXie? – Julian Sep 20 '22 at 11:27
  • @Julian It's been too long, so I may not remember well, but you may try to set the option `table_css` to `false` in `bookdown::gitbook`. Then you can bring your own CSS rules for tables. See `?bookdown::gitbook`. – Yihui Xie Sep 20 '22 at 16:25
  • Yes I tried that one as well (and it works), however, I was wondering where I can find the table-css from gitbook, such that I can reuse that and just turn off the stripes. – Julian Sep 20 '22 at 16:35

0 Answers0