Answer the question
In order to leave comments, you need to log in
How can rows (tr) be made links in HTML in a table?
I wrote a before tr, but it does not accept these tags. How can a solution be found?
Answer the question
In order to leave comments, you need to log in
I wrote a before tr, but it does not accept these tags.
<style>
.table {
display: table;
}
.table > a {
display: table-row;
}
.table > a > div {
display: table-cell;
}
</style>
<div class="table">
<a href="#">
<div>1-1</div><div>1-2</div><div>1-3</div>
</a>
<a href="#">
<div>2-1</div><div>2-2</div><div>2-3</div>
</a>
</div>
<table>
<tr onclick="document.location = 'example.com';">
<td>1-1</td><td>1-2</td><td>1-3</td>
</tr>
<tr onclick="document.location = 'example.com';">
<td>2-1</td><td>2-2</td><td>2-3</td>
</tr>
</table>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question