Beautiful tables

Communicating with Data in the Tidyverse

Timo Grossenbacher

Data Journalist

Communicating with Data in the Tidyverse

Communicating with Data in the Tidyverse

YAML header to the rescue!

 ---
 title: "The reduction in weekly working hours in Europe" 
 subtitle: "Looking at the development between 1996 and 2006"
 author: "Timo Grossenbacher"
 output: 
   html_document:
     theme: cosmo
     highlight: monochrome
     toc: true
     toc_float: false
     toc_depth: 4
     code_folding: hide
     css: styles.css

df_print: kable ---
    df_print: paged
 ---
Communicating with Data in the Tidyverse

The second option

# Some summary statistics
ilo_data %>%
  filter(country == "Switzerland" & year > 2000) %>% 

knitr::kable()

Communicating with Data in the Tidyverse

Styling tables

<table>
  <thead>
   ...
  </thead>
  <tbody>
   ...
  </tbody>
</table>
Communicating with Data in the Tidyverse

Styling tables

<table>
  <thead>
   <tr>
     ...
   </tr>
  </thead>
  <tbody>
   <tr>
     ...
   </tr>
   <tr>
     ...
   </tr>
  </tbody>
</table>
Communicating with Data in the Tidyverse

Styling tables

<table>
  <thead>
   <tr>
     <th>Column 1</th><th>Column 2</th>
   </tr>
  </thead>
  <tbody>
   <tr>
     <td>Cell 1</td><td>Cell 2</td>
   </tr>
   <tr>
     ...
   </tr>
  </tbody>
</table>
Communicating with Data in the Tidyverse

Let's practice!

Communicating with Data in the Tidyverse

Preparing Video For Download...