Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML: is there any way to make clickable <td> o <tr> tags?

Tags:

html

hyperlink

Is there any way to make clickable <td> or <tr> tags?

like image 636
ziiweb Avatar asked Oct 17 '10 13:10

ziiweb


4 Answers

<td><a href="foo">bar</a></td>
like image 136
Lie Ryan Avatar answered Oct 30 '22 10:10

Lie Ryan


<td onclick="window.location = 'index.html';">cell content</td>

index.html above can be any URL or internal page link. Note: the mouse pointer does not turn into a pointing hand when you mouse over the cell using this javascript method, but clicking on the cell does take you to the URL.

like image 30
Bob Avatar answered Oct 30 '22 11:10

Bob


To turn non-link tags into links, use @Lie Ryan's answer and put an a into the element.

To be able to link to an element:

Use an a

<a href="#idOfTheElement">Link to the element</a>

and a named point:

<td id="idOfTheElement">contents</td>
like image 42
David Thomas Avatar answered Oct 30 '22 11:10

David Thomas


<td><a name="foo"/>bar</td>
like image 23
Thilo Avatar answered Oct 30 '22 12:10

Thilo