Recap: Data Tables
Part of the Responsive UI Patterns section of Coddy's Tailwind CSS journey. Lesson 25 of 55.
Challenge
HardBuild a schedule viewport capped at 440px wide and 192px tall, scrollable on both axes. Keep its native table 600px wide with fixed layout and a 200px first column. Make both column headers sticky at the top with white backgrounds and stacking level 10. Preserve the caption and all header scopes.
Preserve the supplied content, semantic elements and IDs. Edit the requested utility classes. Press Run preview after edits, then Check/Run code to grade the result. Supplied JavaScript is read-only.
Try it yourself
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Interface workshop</title><link rel="stylesheet" href="./styles.css"></head><body>
<div id="wrap" class="w-full max-w-[440px] h-48 overflow-hidden"><table id="table" class="w-[600px] border-separate border-spacing-0 table-auto"><caption>Studio schedule</caption><colgroup><col class="w-[200px]"><col></colgroup><thead><tr><th scope="col" class="bg-white">Session</th><th scope="col" class="bg-white">Room</th></tr></thead><tbody><tr id="r1" class=""><th scope="row">Session 1</th><td id="cell1">Room 1</td></tr><tr id="r2" class=""><th scope="row">Session 2</th><td id="cell2">Room 2</td></tr><tr id="r3" class=""><th scope="row">Session 3</th><td id="cell3">Room 3</td></tr><tr id="r4" class=""><th scope="row">Session 4</th><td id="cell4">Room 4</td></tr><tr id="r5" class=""><th scope="row">Session 5</th><td id="cell5">Room 5</td></tr><tr id="r6" class=""><th scope="row">Session 6</th><td id="cell6">Room 6</td></tr><tr id="r7" class=""><th scope="row">Session 7</th><td id="cell7">Room 7</td></tr><tr id="r8" class=""><th scope="row">Session 8</th><td id="cell8">Room 8</td></tr><tr id="r9" class=""><th scope="row">Session 9</th><td id="cell9">Room 9</td></tr><tr id="r10" class=""><th scope="row">Session 10</th><td id="cell10">Room 10</td></tr><tr id="r11" class=""><th scope="row">Session 11</th><td id="cell11">Room 11</td></tr><tr id="r12" class=""><th scope="row">Session 12</th><td id="cell12">Room 12</td></tr></tbody></table></div>
</body></html>
All lessons in Responsive UI Patterns
1Page Shells
Growing Page ShellsFlexible Content RailsBounded Scroll RegionsFull-Bleed RegionsRecap: Page Shells4Form Layouts
Responsive Field GroupsFocused Field GroupsSelectable Form OptionsNative Validation CuesRecap: Form Layouts2Navigation Patterns
Wrapping NavigationCurrent Page CuesNative Menu DisclosuresKeyboard Skip LinksRecap: Navigation5Data Tables
Scrollable Data TablesPredictable Table ColumnsRow State PresentationSticky Table HeadersRecap: Data Tables8Interactive Panels
Expanded Control CuesChoice Card StatesFocus-Aware Help PanelsContent-Aware Empty StatesRecap: Interactive Panels11Project: Event Portal
Portal ShellSession Browser