/    Sign up×
Community /Pin to ProfileBookmark

Linking a td?

I have been doing some searching on various sites and search engines looking for a way to link an entire td. I have found one way to link a td which I will list below but the way that I’m using isn’t approved for the strict dtd. I want to know if there is a way to link an entire td that will work with the strick dtd. Here is the way I found to do it:

[code]<a href=”mypage.html”><td>My text here.</td></a>[/code]

I will appreciate any and all help anybody can give me. Thanks. ?

to post a comment
HTML

9 Comments(s)

Copy linkTweet thisAlerts:
@SamFeb 14.2004 — think your best bet here is to use css to make the <a> fill the entire td. Same effect, but entirely compliant
Copy linkTweet thisAlerts:
@JickauthorFeb 14.2004 — Well could you or somebody explain that. I'm still open to other idas as well...
Copy linkTweet thisAlerts:
@Daniel_TFeb 14.2004 — For example:
<i>
</i>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Untitled&lt;/title&gt;
&lt;style type="text/css"&gt;
#linkedtd {
height:200px;
width:200px;
}
#linkedtd a {
display:block;
width:100%;
height:100%;
}
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;table style="border:1px solid #000;" cellspacing="0" cellpadding="0"&gt;
&lt;td id=linkedtd&gt;&lt;a href="linkedpage.html"&gt;Link text&lt;/a&gt;&lt;/td&gt;
&lt;/table&gt;


&lt;/body&gt;
&lt;/html&gt;


hope this helps,

-Dan
Copy linkTweet thisAlerts:
@conicSectionFeb 14.2004 — Or you could use a simple onClick event handler:

<td onClick="href='http://www.blah.com'"> BLAH </td>
Copy linkTweet thisAlerts:
@Paul_JrFeb 14.2004 — [i]Originally posted by conicSection [/i]

[B]Or you could use a simple onClick event handler:



<td onClick="href='http://www.blah.com'"> BLAH </td> [/B]
[/QUOTE]

That would make your page inaccessible to users without JS available/enabled.
Copy linkTweet thisAlerts:
@fredmvFeb 14.2004 — [i]Originally posted by conicSection [/i]

[B]<td onClick="href='http://www.blah.com'"> BLAH </td> [/B][/QUOTE]
That isn't correct syntax (and therefore would not work) and it isn't a good practice to make something as important as the site's navigation rely on JavaScript.

As for the original poster, why is your link in a table cell anyway? ?
Copy linkTweet thisAlerts:
@etLuxFeb 15.2004 — I don't quite follow why you would want do this:

<a href="mypage.html">

<td>My text here.</td>

</a>

Why not simply link the text, per usual, like this:

<td>

<a href="mypage.html">My text here.</a>

</td>
Copy linkTweet thisAlerts:
@pyroFeb 15.2004 — Might want to read how to [URL=http://www.alistapart.com/articles/taminglists/]tame a list[/URL], as that will probably be better than using a table cell.
Copy linkTweet thisAlerts:
@Ben_RogersFeb 15.2004 — If you're going for the effect I think you are then maybe you would want to add a display: block; to the style rule for the link so the whole line it's on will light up :hover if thats what you set the style to do... a link maybe or a pic of the desired effect would be good.

and, pyro, do you look up a link every time u post??!
×

Success!

Help @Jick spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...