|
-
May 20th, 2004, 07:24 AM
#1
Thread Starter
New Member
xhtml: creating a link out of a <td> [resolved]
Im trying to create links from <td> tags that i have in my site. I realise that i can put the whole <td> in a <a> tag, or put a <div> within a <a> within a <td>, but dreamweaver picks both of these up as xhtml 1.0 incompat's as i'm trying to make the site comply with it, i dont know what to do.... thanks in advance.
Last edited by llamabird; Jun 1st, 2004 at 03:02 AM.
-
May 20th, 2004, 07:47 AM
#2
Frenzied Member
This is perfectly valid XHTML 1.0 strict:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<table width="75%" border="1">
<tr>
<td>text</td>
<td>text</td>
<td>text</td>
</tr>
<tr>
<td>sid was here</td>
<td><a href="pag2.html">a link</a></td>
<td>more text</td>
</tr>
<tr>
<td>moo</td>
<td>wee</td>
<td>even more</td>
</tr>
</table>
</body>
</html>
according to the W3C validator
-
May 20th, 2004, 07:50 AM
#3
Frenzied Member
I think you were trying to put a td tag within an a tag when it should be an a tag within a td tag.
-
May 21st, 2004, 05:28 AM
#4
Thread Starter
New Member
That's how i'v got it at the moment, but it means that you have to click on the text in the <td> to follow the link, i want to make it so that when you click anywhere in the <td> it will go to the href i specify. I thought this might be achievable with a onmousedown but i don't know the js to link to a new page.
-
May 21st, 2004, 05:54 AM
#5
Frenzied Member
Code:
<script type="text/javascript">
function goto_URL(URL) {
location.href=URL
}
</script>
<td onmousedown="goto_URL('pag2.html')">
I haven't tested that but I'm pretty sure it is XHTML compliant.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|