From the course: R: Interactive Visualizations with htmlwidgets

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Design responsive (mobile-ready) tables

Design responsive (mobile-ready) tables - R Tutorial

From the course: R: Interactive Visualizations with htmlwidgets

Start my 1-month free trial

Design responsive (mobile-ready) tables

- [Instructor] Responsively designed web content reflows or reformats itself dependent on the width of your browser window. It's a very flexible way of designing websites or web applications to work across desktop and mobile devices. The DT Library provides a very simple method for creating responsive tables. Let's have a look at that. I'll open up my interactive-table.R file. Minimize my environment because I don't need to see it. At the top of the script file, we load the tidyverse library, then we load the DT library so we can make our interactive tables, and finally, the stringr library so we can create pretty headers very easily. Line five, I import my data using read_csv, and I create some pretty headers by using gsub and a str_to_title function from stringr. Then on line 10 through 16, I create myself an interactive data table. As you can see, there are many columns on this data frame which are over to the right-hand side, and I need to scroll to access them. It'd be really…

Contents