Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

Vertically align column name using kable and rendering with rmarkdown into html

$
0
0

Created the table below and would like to vertically align the word "Species" in the center/middle of the cell. I am using RMarkdown to generate the HTML not LateX. Any tips?

enter image description here

---
title: "Untitled"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE )


library( kableExtra )
options( scipen = 99 )

```

```{r iris}

tab_iris <- knitr::kable( iris , format = "html" , col.names = c( "Sepal<br>Length" , "Sepal<br>Width" , "Petal<br>Length" , "Petal<br>Width" , "Species" ) , align = "c" , escape = F ) %>% kable_styling(full_width = F , bootstrap_options = c( 'hover', 'condensed' , 'bordered'), position = 'left') %>% add_header_above( c('Kendal Iris Test' = 5) , bold = TRUE , background = '#0077c8' , color = 'white' ) 

```

`r tab_iris`

Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>