giva a <tr> a link

S

Stijn Goris

hi all,

I do
<table>
<a href="..">
<tr>
<td>
content
</td>
</tr>
</a>
</table>

When I go over the content the arrow doesn't change from the usual arrow to
the hand (normal when hovering above a link) but the edit cursor shows up (T
with feet). Is use IE 6.0. It seems that IE doesn't work wel with tr that
have a link. Can I make this work in IE and other browser in another way
(maybee CSS)?

Regards
Srijn
 
M

Matt N. Jones

Stijn Goris said:
hi all,

I do
<table>
<a href="..">
<tr>
<td>
content
</td>
</tr>
</a>
</table>

When I go over the content the arrow doesn't change from the usual arrow to
the hand (normal when hovering above a link) but the edit cursor shows up (T
with feet). Is use IE 6.0. It seems that IE doesn't work wel with tr that
have a link. Can I make this work in IE and other browser in another way
(maybee CSS)?

Try this:

<table>
<tr>
<td>
<a href="..">
content
</a>
</td>
</tr>
</table>

You're making the mistake of trying to put a table row inside an anchor
tag. It should be the other way round.

Matt
 
M

Michael Winter

[snip]
<table>
<a href="..">
<tr>
<td>
content
</td>
</tr>
</a>
</table>

You cannot place a table row inside a link for two reasons:

1) Links cannot be the child of any table-related element, other than a
cell. That means that:

<table>
<a ...><tbody> or <a ...><tr>

<tbody>
<a ...><tr>

<tr>
<a ...><td>

are all invalid. Only

<td><a ...>

is possible.

2) Links can only contain inline elements - text, images, phrase elements
(STRONG, CODE, etc), and the like. Table rows would be, if anything,
block-level elements.

I'm afraid you'll have to rethink your design, unless adding links with
the same destination to all table cells in a row is acceptable. Even then
you'll have problems if those cells contain block-level elements.

[snip]

Mike
 
Y

yandr

Stijn Goris said:
hi all,

I do
<table>
<a href="..">
<tr>
<td>
content
</td>
</tr>
</a>
</table>

As others have posted, this is not valid HTML.

However, if what you are trying to do is make the whole ROW of the table
behave as a link, you will have to resort to CSS and even then you will
only be able to turn a TD into a whole link.

--

Fleur de Coin
- http://www.fleur-de-coin.com/
Åëëçíéêüò óôñáôüò
- http://skopia.digitalrice.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top