Project: Semantic Learning Dashboard
Represent real data as a table
A dashboard should communicate data independently of layout. Use a caption, column headings and row headings. The example contains fictional completion counts, not live learner data.
<table> <caption>Completed lessons</caption> <tr> <th scope="col">Course</th> <th scope="col">Count</th> </tr> <tr> <th scope="row">HTML</th> <td>12</td> </tr></table>A data table with a caption and explicit header scopes.
Choose native indicators and controls
Progress describes completion of a task; meter describes a scalar within a known range. Label both controls. A dialog is suitable for a focused report that users can dismiss. Use a native button as the trigger.
<label for="done">Completion</label><progress id="done" value="12" max="20">12 of 20</progress><label for="storage">Storage used</label><meter id="storage" min="0" max="100" value="35">35%</meter>The two indicators communicate distinct meanings.
Assemble dashboard behavior
Use a template to hold a repeatable notice and clone it into the document. The report dialog uses showModal and a form with method dialog to close without a network submission. Check keyboard opening, Escape dismissal and focus restoration.
<main> <h1>Learning dashboard</h1> <section> <h2>Course status</h2> <table> <caption>Completed lessons</caption> <thead> <tr> <th scope="col">Course</th> <th scope="col">Completed</th> </tr> </thead> <tbody> <tr> <th scope="row">HTML</th> <td>12</td> </tr> <tr> <th scope="row">CSS</th> <td>8</td> </tr> </tbody> </table> <label for="progress">HTML course completion</label> <progress id="progress" value="12" max="20">12 of 20</progress> </section> <button type="button" id="show">View report</button> <dialog aria-labelledby="report-title" id="report"> <h2 id="report-title">Report</h2> <p>12 HTML lessons completed.</p> <form method="dialog"> <button>Close</button> </form> </dialog> <template id="notice"> <p class="notice">Practice a little each day.</p> </template> <div id="notices"></div></main><script> const dialog=document.querySelector('#report');document.querySelector('#show').addEventListener('click',()=>dialog.showModal());document.querySelector('#notices').append(document.querySelector('#notice').content.cloneNode(true));</script>A dashboard with a cloned notice and a closed report dialog ready for activation.
Common mistakes and practice
Test the table headers, indicator names, dialog focus and repeated template instances. Keep essential course status visible outside the dialog. Do not replace tables with positioned divs, or progress with an unlabeled colored bar. See projects/dashboard.html.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Project: Semantic Learning Dashboard — Knowledge Check
Apply the project design and review concepts taught in this lesson.
Which element represents completion?
What identifies a column header?
How does a modal dialog open?
What does cloning template.content preserve?
What should Escape normally do in a modal?