inline table styling with Blastula

Blastula appears to not respect the <style> tags used by table formatting packages like kableextra and formattable. (Prior unsolved issues here and here).

Example:

library(kableExtra)
library(blastula)

dt <- mtcars[1:5, 1:6]

tbl <- dt %>%
  kbl() %>%
  kable_styling()

tbl

compose_email(
  body = md(c(
    "this is my table:",
    tbl
    )))

Displays this when printing tbl

But this when printing the compose_email version:

I think the solution is to use inline formatting.

Is there a way to add inline table styling to tables to get:

  • 2 px grey border under the header row
  • 1 px light grey border between the table rows
  • Minimum row height or padding to space the table a little more

Bonus points for changing the font and adding column padding!