```{r include=FALSE}
dat <- cbind(
  data.frame(car = row.names(mtcars), stringsAsFactors = FALSE),
  mtcars )
```

# Tables {#tables}


This is famous `mtcars` dataset:

```{r tab.cap='mtcars', tab.id='mtcars', first_column = TRUE}
head(dat, n = 10)
```


This is famous `iris` dataset:

```{r tab.cap='iris', tab.id='iris', no_hband = TRUE, first_column = FALSE}
head(iris)
```


This a flextable:

```{r tab.cap='flextable', tab.id='flextable'}
if(require("flextable")){
  ft <- flextable(head(mtcars, n = 10))
  ft <- fontsize(ft, size = 9, part = "all")
  ft <- compose(x = ft, j = "mpg",
    value = as_paragraph(
      value = lollipop(value = mpg, min = 0, max = 30, positivecol = "#DD2233", rangecol = "#DD2233")
      ))
  ft <- compose(x = ft, j = "drat",
    value = as_paragraph(
      value = minibar(value = drat, max = 6, barcol = "#DD3322")
      ))
  ft <- compose(x = ft, j = "qsec",
    value = as_paragraph(
      value = linerange(value = qsec)
      ))
  ft <- set_table_properties(ft, layout = "autofit")
  ft
  }
```

