1:nrow(x). that in the header argument as c(" " = 1, "Year" = 5). Since knitr::kable() is simple by design (please feel free to read this as Yihui is lazy), it definitely has a lot of missing features that are commonly seen in other packages, and kableExtra has filled the gap perfectly. Thank you. See Launching the CI/CD and R Collectives and community editing features for Change the column names of the data frame only for display purpose. are a number of functions in kableExtra that help with this. How can I make a div not larger than its contents? For example, we substitute the dots with spaces in the column names of the iris data: The col.names argument can take an arbitrary character vector (not necessarily the modified column names via functions like gsub()), as long as the length of the vector is equal to the number of columns of the data object, e.g.. To change the alignment of the table columns, you can use either a vector of values consisting of characters l (left), c (center), and r (right) or a single multi-character string for alignment, so kable(, align = c('c', 'l')) can be shortened to kable(, align = 'cl'). anything over the state column, so we can use the marker " " to indicate that then five (the years) that will all get the same header (Year), we can express Well occasionally send you account related emails. This may not feel natural when we read them in a table. What I have tried to do is suppress the printing of the data frame names and use add_header_above for better names and names that span several columns. By default or if You can set this option as a global R option so you do not need to set it for every single table, e.g., options(knitr.table.vline = ""). Could very old employee stock options still be accessible and viable? ". How can I set the default value for an HTML