Interactive tables with looking and sorting can be a great way of discovering info. And often, you could want to share that info with other persons — like text-only info like a record of Do Much more With R video clip tutorials.

But when that info includes a column with fairly extended entries, that column might not healthy nicely in a table the width of your monitor. This can be primarily tricky when not each row includes the pretty-huge column. For example, a table of questionnaire effects wherever just one field is “Do you have any further remarks?” Not anyone might.

Which is wherever a table with expandable rows can occur in handy. At the NICAR info journalism meeting previously this calendar year, I posted a variety so speakers (and other attendees) could post backlinks to session displays. Some persons included further remarks other people didn’t. Showing that column by default would waste a lot of monitor authentic estate.

Alternatively, that remark field displays in my interactive table of NICAR resources only if a consumer clicks on the increase-row icon. Not each row can be expanded with a clickable icon at the still left of the Subject matter title simply because not each row has info in that field, as you can (hopefully) see in the screenshot down below.

table with expandable rows Sharon Machlis, IDG

R-produced table with some rows that are expandable to display far more information and facts. 

Let’s see how to make a table like this. 

If you’d like to follow alongside, install and load the reactable package deal. For this demo, you will also need the rio, glue, htmltools, and dplyr packages mounted.

You can obtain the info I’ll use in this demo from the hyperlink down below. It’s a tiny (fifteen rows) info established about R and Python periods at this year’s NICAR meeting.

Copyright © 2020 IDG Communications, Inc.