Your daily frequent11y newsletter, brought to you by @ChrisBAshton:
Under-Engineered Responsive Tables
- Adrian Roselli describes how to create an accessible table that scrolls horizontally on mobile. You need to put your
<table>
element inside a<div role="region" aria-labelledby="mycaption" tabindex="0">
, where “mycaption
” references the<caption id="
that should be inside the table. Themycaption
">tabindex
satisfies WCAG Success Criteria 2.1.1 Keyboard, and thearia-labelledby
satisfies 4.1.2 Name, Role, Value. For the CSS, applyoverflow: auto
to the table, and don’t forget to apply a focus style.
Prefer longer newsletters? You can subscribe to week11y, fortnight11y or even month11y updates! Every newsletter gets the same content; it is your choice to have short, regular emails or longer, less frequent ones. Curated with ♥ by developer @ChrisBAshton.