Having some trouble with my HTML report created from RMarkdown and applying CSS. The browser version displays correctly, but when printed, the styling doesn't come through. Below is an example of the RMarkdown code:
---
title: "Table"
output:
html_document:
css: "test.css"
---
{r}
library(knitr)
data(iris)
kable(iris)
This is the content of my test.css file:
.main-container {
max-width: 1600px !important;
}
tr:nth-child(even) {background-color: #f2f2f2}
th {
background-color: #FF6319;
color: white;
font-size: 12px;
}
tbody {
font-size: 12px;
}
hr {
page-break-after: always;
}
I'm struggling to achieve consistent results between browser output and printed output. I've even tried toggling the background graphics option in Chrome's printing menu, but nothing seems to make a difference. Any suggestions on how to resolve this issue would be greatly appreciated.