Accessibility / Analysis / Table Structure Verifier

The Table Structure Verifier bookmarklet validates header associations in data tables. Finds all tables on the page, identifies data cells (td), checks if each cell has properly associated headers via the `headers` attribute or `scope` attributes on header cells, outlines cells without clear header associations in red, and displays an alert with the count of problematic cells. Useful for verifying that data tables have proper header relationships for screen reader users. Note: Does not check layout tables, which should not have headers.

WCAG SC 1.3.1: Info and Relationships
Run Table Structure Verifier

Test run or drag to
bookmarklets bar to install

javascript:%21function()%7B%22use%20strict%22%3Btry%7Bconst%20e%3D%5B...document.querySelectorAll(%22table%22)%5D%3Bif(%21e.length)return%20void%20alert(%22No%20tables%22)%3Blet%20t%3D0%3Bfunction%20r(e%2Ct)%7Bconst%20r%3D%5B...t.querySelectorAll(%22th%22)%5D%2Co%3D(e.getAttribute(%22headers%22)%7C%7C%22%22).split(%2F%5Cs%2B%2F).filter(Boolean).map(e%3D%3Edocument.getElementById(e)).filter(Boolean)%3Bif(o.length)return%20new%20Set(o)%3Bconst%20l%3Dnew%20Set%2Cn%3De.parentElement%2Ca%3D%5B...n.children%5D.indexOf(e)%3Bfor(const%20e%20of%20r)%7Bconst%20t%3D(e.getAttribute(%22scope%22)%7C%7C%22%22).toLowerCase()%3Bif(%22col%22%3D%3D%3Dt)%7B%5B...e.parentElement.children%5D.indexOf(e)%3D%3D%3Da%26%26l.add(e)%7Delse%22row%22%3D%3D%3Dt%26%26e.parentElement%3D%3D%3Dn%26%26l.add(e)%7Dreturn%20l%7De.forEach(e%3D%3E%7B%5B...e.querySelectorAll(%22td%22)%5D.forEach(o%3D%3E%7Br(o%2Ce).size%7C%7C(o.style.outline%3D%223px%20solid%20%23e00%22%2Ct%2B%2B)%7D)%7D)%2Calert(%60Cells%20without%20clear%20headers%3A%20%24%7Bt%7D%60)%2Cconsole.log(%22%5CnSource%3A%20https%3A%2F%2Fgithub.com%2Falejandrogiga98%2FA11y-Bookmarklets%5CnBookmarklet%20name%3A%20Table%20structure%20verifier%5CnAuthor%3A%20alejandrogiga98%5CnLicense%3A%20MIT%20License%5Cn%22)%7Dcatch(o)%7Balert(%22Bookmarklet%20Error%3A%20%22%2Bo.message)%7D%7D()%3B
← Back to all bookmarklets