Okay, here is the Code:
output:
html_document: Default
library(knitr)
library(kableExtra)
options(knitr.table.format = "html")
d <- read.csv2{"Data/table.csv"}
tbl <- t(cbind(
TK(d$Tm.,'$T_{m}$',s,g),
TK{d$A, 'A',s,g},
TK{d$B,'B',s,g},
TK{d$C, 'C',s,g},
TK{d$m2, '$m^2$',s,g},
))
Info: TK is a written (and sourced) function with the Parameters "d, Name, s, g". Within TK there is the command:
tbl2 <- cbind(1,2,3,4)
colnames(tbl2) <- c("1","2","3","4")
rownames(tbl2) <- c(Name)
return(t(tbl2))
The only interesting Parameter is "Name", because the Vector of rownames is created with it.
Again in the original Markdown Code:
kable(tbl, escape = FALSE, format = 'html', booktabs=TRUE, caption = "Table 1", align = "c") %>%
kable_styling(latex_options = "scale_down") %>% #can be deleted as you said
pack_rows("1", 1, 3)%>%
pack_rows("2", 4,5)%>%
kable_styling(bootstrap_options = c("striped", "hover"), full_width = F)
Without the last three commands everything works fine, but doesn't look good. With the last three commands it looks good, but the latex-codes are printed as raw-codes.