col
Cols, colgroups and css “:hover” pseudoclass
Here’s a pure CSS method using no JavaScript. I used ::before and ::after pseudo-elements to do the row and column highlighting. z-index keeps the highlighting below the <td>s in case you need to handle click events. position: absolute allows them to leave the confines of the <td>. overflow: hidden on the <table> hides the highlight … Read more
Convert row names into first column
Or you can use tibble‘s rownames_to_column which does the same thing as David’s answer: library(tibble) df <- tibble::rownames_to_column(df, “VALUE”) Note: The earlier function called add_rownames() has been deprecated and is being replaced by tibble::rownames_to_column()