Changing the column width in R kable does not change the width of the headers

I use kable to create my data tables in RMarkdown. You can probably adjust the width of the column using the column_spec command , however, it seems that it adjusts only the data columns itself, but also does not adjust the column width of my header row. So now my headers no longer match the corresponding data column.

For instance:

    y <- knitr::kable(head(mtcars), "html")
    column_spec(y, 1:4, width="5em")
+4
source share

Source: https://habr.com/ru/post/1688476/


All Articles