Skip to content

How to make table row a clickable link? #3502

Answered by richadr
iamsaumya asked this question in Help
Discussion options

You must be logged in to vote

Inserting an <a> around <tr> in a <table> is not valid html. See "Permitted content" in https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table

You can use onclick handler on the <tr> and use a bit of JavaScript, or my preferred way, use <div> tags and use Tailwind's .table, .table-row, .table-cell classes to give them table behavior and styling.

https://tailwindcss.com/docs/display#class-reference

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@iamsaumya
Comment options

@ZainabBabayaro
Comment options

@JayMGurav
Comment options

Answer selected by iamsaumya
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@wiledal
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
7 participants