SlideShare a Scribd company logo
Flipping Tables
Displaying Data on Small Screens
#flipdata
Flipping Tables: Displaying Data on Small Screens
Flipping Tables: Displaying Data on Small Screens
Flipping Tables: Displaying Data on Small Screens
Flipping Tables: Displaying Data on Small Screens
Flipping Tables: Displaying Data on Small Screens
Flipping Tables: Displaying Data on Small Screens
Flipping Tables: Displaying Data on Small Screens
Flipping Tables: Displaying Data on Small Screens
Flipping Tables: Displaying Data on Small Screens
Tables
Flipping Tables: Displaying Data on Small Screens
Am I right?
( °□°)
( °□°)
• When to use tables
( °□°)
• When to use tables
• Creating structure with HTML
( °□°)
• When to use tables
• Creating structure with HTML
• Designing tables
( °□°)
• When to use tables
• Creating structure with HTML
• Designing tables
• Adding style with CSS
( °□°)
• When to use tables
• Creating structure with HTML
• Designing tables
• Adding style with CSS
• Adapting tables to small screens
( °□°)
Sorry!
Flipping Tables: Displaying Data on Small Screens
Flipping Tables: Displaying Data on Small Screens
Flipping Tables: Displaying Data on Small Screens
Flipping Tables: Displaying Data on Small Screens
When to use tables
When to use tables
When to use tables
• Sort
When to use tables
When to use tables
• Sort
• Compare
When to use tables
When to use tables
• Sort
• Compare
• Cross Reference
When to use tables
When to use tables
• Sort
• Compare
• Cross Reference
• Calculations
When to use tables
When to use tables
• Sort
• Compare
• Cross Reference
• Calculations
When to use tables
not
When to use tables
not
<h5>Players:</h5>
<ul>
<li>Daniel Sedin</li>
<li>Henrik Sedin</li>
<li>Jannik Hansen</li>
<li>Bo Horvat</li>
</ul>
When to use tables
not
When to use tables
not
.players {
column-count:2;
}
When to use tables
not
When to use tables
not
img {
float: left;
}
When to use tables
not
/* Nicole Sullivan’s Media Object */
<div class="media">
<div class="img">
<img src="" alt="" />
</div>
<div class="body">
…
</div>
</div>
When to use tables
not
layout
When to use tables
not
Tables Good
• Sort
• Compare
• Cross Reference
• Calculations
layout
Tables Bad
Flipping Tables: Displaying Data on Small Screens
Creating structure
with HTML
Creating structure with HTML
<table>
</table>
Creating structure with HTML
Creating structure with HTML
<table>
<caption>…</caption>
</table>
Creating structure with HTML
Creating structure with HTML
<table>
<caption>…</caption>
<colgroup>
<col span=“” class=“”>
</colgroup>
</table>
Creating structure with HTML
Creating structure with HTML
<table>
<caption>…</caption>
<colgroup>…</colgroup>
<thead>…</thead>
<tbody>…</tbody>
<tfoot>…</tfoot>
</table>
Flipping Tables: Displaying Data on Small Screens
<a href=“#revenues”>
<a href=“#expenses”>
<tbody id=“revenues”>…
<tbody id=“expenses”>…
Creating structure with HTML
<table>
<caption>…</caption>
<colgroup>…</colgroup>
<thead>…</thead>
<tbody>…</tbody>
<tfoot>…</tfoot>
</table>
Creating structure with HTML
Creating structure with HTML
<tr>
<th scope=“row"></th>
<td></td>
<td></td>
</tr>
Creating structure with HTML
<tr>
…
<td colspan=""></td>
<td rowspan=""></td>
</tr>
Creating structure with HTML
Creating structure with HTML
<th scope="row" colspan="2">
Team total
</th>
Creating structure with HTML
<table>
<caption>
<colgroup span>
<col />
<thead>
<tbody>
<tr>
<th scope colspan rowspan>
<td colspan rowspan>
<tfoot>
Designing tables
Designing tables
Flipping Tables: Displaying Data on Small Screens
Designing tables
Designing tables
• Provide a caption
Designing tables
• Provide a caption
• Identify columns, rows, and headers
Designing tables
• Provide a caption
• Identify columns, rows, and headers
• Enhance readability
Designing tables
• Provide a caption
• Identify columns, rows, and headers
• Enhance readability
• Group similar data
Designing tables
• Provide a caption
• Identify columns, rows, and headers
• Enhance readability
• Group similar data
• Smart defaults
Designing tables
• Contrast
• Repetition
• Alignment
• Proximity
Designing tables
Designing tables
Designing tables
Designing tables
Designing tables
- John Maeda, Designer
“Simplicity is about subtracting
the obvious and adding the
meaningful.”
Flipping Tables: Displaying Data on Small Screens
Designing tables
• www.darkhorseanalytics.com/blog/
clear-off-the-table/
• www.behance.net/gallery/Designing-
Effective-Data-Tables/885004
• understandinggraphics.com/design/
data-table-design/
Flipping Tables: Displaying Data on Small Screens
Adding style with CSS
Adding style with CSS
border-collapse: separate;
border-spacing: 2px;
Adding style with CSS
border-collapse: separate;
border-spacing: 10px;
Adding style with CSS
border-collapse: collapse;
border-spacing: 10px;
Adding style with CSS
caption-side: top;
Adding style with CSS
caption-side: top-outside;
Adding style with CSS
caption-side: bottom;
Adding style with CSS
caption-side: right;
Adding style with CSS
caption-side: right;
figure {
display: table;
caption-side: bottom; }
figcaption {
display: table-caption; }
Adding style with CSS
Adding style with CSS
vertical-align: middle;
Adding style with CSS
.parent {
display: table; }
.child {
display: table-cell;
height: 100vh;
vertical-align: middle;
}
Adding style with CSS
th { }
tbody th { }
tbody th[scope="row"] { }
th.special { }
Adding style with CSS
colgroup { }
col { }
Adding style with CSS
colgroup { }
col { }
<col class=“points">
.points {
background-color: #eee; }
Adding style with CSS
Adding style with CSS
Adding style with CSS
tbody td:nth-child(5) {
background-color: #ddd;
}
Adding style with CSS
tr:nth-child(even) {
background-color: #ddd;
}
Adding style with CSS
Adding style with CSS
A note about screen readers
layout
Adding style with CSS
Adding style with CSS
• A note about screen readers
Flipping Tables: Displaying Data on Small Screens
Adapting tables to
small screens
Adapting tables to small screens
• Shrink
Shrink
Shrink
<th><abbr title=“Points”>P</abbr></th>
@media (min-width: 64em) {
abbr { font-size: 0;}
abbr::after {
content: attr(abbr);
font-size: 1rem;
Shrink
Shrink
Shrink
Shrink
Adapting tables to small screens
• Shrink
• Linearize or flip ( °□°)
Linearize
table, thead, tbody, tfoot,
tr, th, td {
display: block;
}
Linearize
Linearize
Linearize
Linearize
td:nth-child(3)::before {
content: 'Goals:';
}
td:nth-child(4)::before {
content: 'Assists:';
}
Linearize
.goals::before {
content: 'Goals:'; }
.assists::before {
content: 'Assists:'; }
.points::before {
content: 'Points:';}
Linearize
<td data-head="Goals:">26</td>
td[data-head]::before {
content: attr(data-head);
}
Linearize
<td data-head="Goals:">26</td>
td[data-head]::before {
content: attr(data-head);
}
Adapting tables to small screens
• Shrink
• Linearize or flip ( °□°)
• Remove
Remove
Remove
Remove
Activity
Remove
Nutrition
Adapting tables to small screens
• Shrink
• Linearize or flip ( °□°)
• Remove
• Scroll
Scroll
Scroll
Scroll
table{
display: block;
overflow: scroll;
}
Scroll
Adapting tables to small screens
• Shrink
• Linearize or flip ( °□°)
• Remove
• Scroll
• Replace
Replace
Replace
Replace
0
1.25
2.5
3.75
5
Jan Feb Mar Apr
First quarter profits rose
2.5%. See the 2016 annual
report for the breakdown.
Replace
Adapting tables to small screens
• Shrink
• Linearize or flip ( °□°)
• Remove
• Scroll
• Replace
• Combo
Combo
Combo
Example
http://v6.robweychert.com/blog/2017/10/robtober/
Example
Example
Example
Example
Example
Example
Combo
• Shrink
• Linearize or flip ( °□°)
• Remove
• Scroll
• Replace
• Combo
Flipping Tables: Displaying Data on Small Screens
Case Study
Case Study
Case Study
Case Study
• github.com/mdn/browser-compat-data
• npm install mdn-browser-compat-data
Case Study
Case Study
Case Study
Case Study
<thead>
<tr>
<th colspan="5">Desktop></th>
<th colspan="5">Mobile</th>
</tr>
<tr>
<th>Chrome</th>
<th>Firefox</th>
Case Study
Case Study
Case Study
Case Study
@media
(min-width: 47.9385em) and
(max-width: 63.9375em) {
…
}
Case Study
@supports (display: grid) {
…
}
Case Study
.bc-table tr {
display: grid;
}
Case Study
.bc-table-10 tr {
grid-template-columns:
repeat(10, 1fr);
}
Case Study
@for $num from 4 through 14{
.bc-table-#{$num} tr {
grid-template-columns:
repeat(#{$num}, 1fr);
}
}
Case Study
.bc-table-4 tr {
grid-template-columns:repeat(4, 1fr);}
.bc-table-5 tr {
grid-template-columns:repeat(5, 1fr);}
.bc-table-6 tr {
grid-template-columns:repeat(6, 1fr);}
Case Study
Case Study
.bc-table tbody th {
grid-column-start: 1;
grid-column-end: last-line;
}
Case Study
Case Study
.platform-desktop,
.platform-mobile {
grid-column-end: span 5;
}
Case Study
@for $num from 4 through 14 {
th[class^=platform-][colspan=‘#{$num}']{
grid-column-end: span #{$num};
}
}
Case Study
@for $num from 4 through 14 {
th[class^=platform-][colspan=‘#{$num}']{
grid-column-end: span #{$num};
}
}
Case Study
th[class^=platform-][colspan='4'] {
grid-column-end: span 4; }
th[class^=platform-][colspan='5'] {
grid-column-end: span 5; }
th[class^=platform-][colspan='6'] {
grid-column-end: span 6; }
Case Study
Case Study
Case Study
Case Study
Case Study
table, thead, tbody,
tr, th, td {
display: block;
}
Case Study
td.browser-firefox:before {
content: ' ';
}
Case Study
Flipping Tables: Displaying Data on Small Screens
• When to use tables
• Creating structure with HTML
• Designing tables
• Adding style with CSS
• Adapting tables to small screens
( °□°)
• When to use tables
• Creating structure with HTML
• Designing tables
• Adding style with CSS
• Adapting tables to small screens
( °□°)
• When to use tables
• Creating structure with HTML
• Designing tables
• Adding style with CSS
• Adapting tables to small screens
( °□°)
• When to use tables
• Creating structure with HTML
• Designing tables
• Adding style with CSS
• Adapting tables to small screens
( °□°)
Flipping Tables: Displaying Data on Small Screens
I Like To Make Websites
Everyone Can Use
stephaniehobson.ca
@stephaniehobson

More Related Content

PDF
Flipping Tables: Displaying Data on Small Screens (2016-02)
PDF
Flipping Tables: Displaying Data on Small Screens (2016-08)
PPSX
CSS Box Model Presentation
PPTX
Introduction to css for product managers
PPT
An Introduction to CSS Frameworks
KEY
CSS Frameworks
PPTX
CSUN 2020: CSS Display Properties Versus HTML Semantics
PDF
Tables and forms with HTML, CSS
Flipping Tables: Displaying Data on Small Screens (2016-02)
Flipping Tables: Displaying Data on Small Screens (2016-08)
CSS Box Model Presentation
Introduction to css for product managers
An Introduction to CSS Frameworks
CSS Frameworks
CSUN 2020: CSS Display Properties Versus HTML Semantics
Tables and forms with HTML, CSS

Similar to Flipping Tables: Displaying Data on Small Screens (20)

PDF
Introduction to Bootstrap
PDF
CSS styling and adding description about
PPTX
HTML Styles - Cascading Style Sheets Cascading Style Sheets
PDF
CSS3 Ready for Primetime
PPS
Introduction to Bootstrap: Design for Developers
PPTX
Web Design HTML for beginners and advanced learners .pptx
PPTX
Introduction to HTML+CSS+Javascript.pptx
PPTX
Bootstrap 5 ppt
PPTX
Static web sites assignment 1 philip lemmon1
PPTX
Introduction to HTML and CSS
PPTX
Css for Development
PPTX
WCBuf: CSS Display Properties versus HTML Semantics
PPTX
Table and Form HTML&CSS
PPTX
diffrent style sheets like cascading style sheets.pptx
PPTX
BITM3730 9-13.pptx
PDF
CSS3 - is everything we used to do wrong?
DOCX
ITM practical file of TANNU AND BIO.docx
PPTX
HTML Tutorials
KEY
Artdm171 Week4 Tags
Introduction to Bootstrap
CSS styling and adding description about
HTML Styles - Cascading Style Sheets Cascading Style Sheets
CSS3 Ready for Primetime
Introduction to Bootstrap: Design for Developers
Web Design HTML for beginners and advanced learners .pptx
Introduction to HTML+CSS+Javascript.pptx
Bootstrap 5 ppt
Static web sites assignment 1 philip lemmon1
Introduction to HTML and CSS
Css for Development
WCBuf: CSS Display Properties versus HTML Semantics
Table and Form HTML&CSS
diffrent style sheets like cascading style sheets.pptx
BITM3730 9-13.pptx
CSS3 - is everything we used to do wrong?
ITM practical file of TANNU AND BIO.docx
HTML Tutorials
Artdm171 Week4 Tags

More from Stephanie Hobson (7)

PDF
Writing for Every Reader - Design and Content
PDF
Writing for Every Reader
PPTX
Web Accessibility: 
Making Websites Better for Everyone
PDF
Mobile First Is Performance First
PPTX
Accessibility with CSS: Making Websites Better for Everyone
PPTX
Geolocation
PPTX
HTML5 Forms OF DOOM
Writing for Every Reader - Design and Content
Writing for Every Reader
Web Accessibility: 
Making Websites Better for Everyone
Mobile First Is Performance First
Accessibility with CSS: Making Websites Better for Everyone
Geolocation
HTML5 Forms OF DOOM

Recently uploaded (20)

PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PDF
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
PPTX
artificial intelligence overview of it and more
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PPTX
Power Point - Lesson 3_2.pptx grad school presentation
PDF
Sims 4 Historia para lo sims 4 para jugar
PPTX
innovation process that make everything different.pptx
PPTX
newyork.pptxirantrafgshenepalchinachinane
PPTX
SAP Ariba Sourcing PPT for learning material
PPTX
Internet___Basics___Styled_ presentation
PPT
Ethics in Information System - Management Information System
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
DOCX
Unit-3 cyber security network security of internet system
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
PPT
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
introduction about ICD -10 & ICD-11 ppt.pptx
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
artificial intelligence overview of it and more
522797556-Unit-2-Temperature-measurement-1-1.pptx
WebRTC in SignalWire - troubleshooting media negotiation
Decoding a Decade: 10 Years of Applied CTI Discipline
Job_Card_System_Styled_lorem_ipsum_.pptx
Power Point - Lesson 3_2.pptx grad school presentation
Sims 4 Historia para lo sims 4 para jugar
innovation process that make everything different.pptx
newyork.pptxirantrafgshenepalchinachinane
SAP Ariba Sourcing PPT for learning material
Internet___Basics___Styled_ presentation
Ethics in Information System - Management Information System
An introduction to the IFRS (ISSB) Stndards.pdf
INTERNET------BASICS-------UPDATED PPT PRESENTATION
Unit-3 cyber security network security of internet system
Design_with_Watersergyerge45hrbgre4top (1).ppt
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt

Flipping Tables: Displaying Data on Small Screens