How to make a table row a link (2020)

Making a table row clickable isn’t as straightforward as it seems. This article delves into the challenges of creating links out of table rows, offering solutions like using JavaScript or adding anchor elements to each table cell. Surprisingly, nesting anchor elements within one another is not valid HTML. Real-world examples from GitHub and Reddit illustrate different approaches to making table rows clickable, and the author questions whether table rows should even be links. Ultimately, the suggestion is to use JavaScript for click events while incorporating anchor elements within the row for URL previews, avoiding making entire rows focusable for better keyboard navigation. The author provides useful resources for creating accessible data tables.

https://robertcooper.me/post/table-row-links

To top