You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: src/modules/table.marko
+23-17Lines changed: 23 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -1659,14 +1659,20 @@ import tableLandscapePic from "/src/routes/static/img/tb-landscape-pic.jpg";
1659
1659
<p>
1660
1660
A sortable table is a table that allows users to sort the data in the table by clicking on the column headers. You can make tables sortable by using sort buttons in <spanclass="highlight"><thead> > <th></span>. Additionally, for accessibility purposes, <spanclass="highlight">aria-sort="ascending"</span> or <spanclass="highlight">aria-sort="descending"</span> should be added respectively to the <spanclass="highlight"><th></span> to reflect the current sort order.
1661
1661
</p>
1662
+
<p>
1663
+
If using buttons to sort the table, the <spanclass="highlight">aria-pressed="true"</span> attribute should be added to the button to indicate the current sort order. The <spanclass="highlight">aria-pressed</span> attribute should be toggled between <spanclass="highlight">true</span> and <spanclass="highlight">false</span> when the button is clicked.
1664
+
</p>
1665
+
<p>
1666
+
If using anchors to sort the table with a page refresh, you would forgo the pressed state and just do <spanclass="highlight"><a href="my-url">Seller...</a></span>. Additionally, you'd need to change the <spanclass="highlight">aria-sort</span> attribute to match the sort order after the page refresh.
1667
+
</p>
1662
1668
<divclass="demo">
1663
1669
<divclass="demo__inner">
1664
1670
<divclass="table"role="group"aria-label="Video games for sale"tabindex="0">
0 commit comments