|
|
|
Re: making table cells into links |
| message from christoff915 on 15 Jul 2004 |
as many of them as possible, but i'm primarily concerned about IE, as our
business is a MCP system builder and networking company. but i'd prefer the
solution that makes it functional (or at least not totally screwed up) on other
browsers as well.
|
| Murray *TMM* replied to christoff915 on 15 Jul 2004 |
Adding event handlers to <td> tags will fail on NN4x and perhaps other
browsers as well, for what it's worth.
Why do you need to make the <td> tag into a link?
|
| John Gaver replied to Murray *TMM* on 15 Jul 2004 |
This kludge seems to work on most browsers.
Put a table inside the cell where you want the link to appear and wrap the
inner table in the link code, as follows:
<a href="file.html" stuff ... ><table width="100%" stuff ...>Text and or
images</table></a>
The whole inner table becomes hot. Since it is the full size of cell of the
outer table, the outer table cell appears to be hot.
I am not aware of any browsers that this is not compatible with, but don't
hold me to that.
John Gaver
Action America
(forget everything to contact me direct)
Microsoft: (n) Job security for IT consultants.
|
| Murray *TMM* replied to John Gaver on 16 Jul 2004 |
This is academically interesting, yet I am sure it's not a good method.
While I am not so fluent with the W3 specs, I feel pretty certain that
having a <table> tag inside an <a> tag is an illegal construction.
Nevertheless, DW doesn't seem to complain when I manually create that,
although its validation report contains this ominous line -
<mm_description><![CDATA[The tag:"table" is not allowed within: "a" It is
only allowed within: button, del, fieldset, iframe, ins, noframes, noscript,
object, td, th.[HTML 4.0]]]></mm_description>
In addition, here is the behavior of such a critter -
<a href="#"><table width="610" border="1" cellpadding="0" cellspacing="0"
bgcolor="#FFFFCC">
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table></a>
1. In IE6/WXPPro, I get a 'finger' ONLY on the border of the table, not
while over the cells themselves. If there is no border (i.e., border="0") I
get no link indication at all.
2. In FF 0.8/WXPPro, I get a 'finger' throughout as you say, but
unfortunately, that 'link-ness' extends from the right end of the table to
the right margin, so blank page space is still a link. This is true whether
the table has a border or not.
3. In Safari 1.0.1, I get the same as FF.
4. In IE5.2/Mac, I find linkage only within the boundary of the table
itself.
It doesn't feel like a production method to me.
|
| christoff915 replied to Murray *TMM* on 16 Jul 2004 |
ok, maybe i'm not being clear....what i'm looking to create is something along
the lines of what gary has on his apptools.com site. a css/table/text driven
pop-up menu that uses a cell as a link instead of just the text. gary has the
css code on his site, but i just can't seem to get it to work with the
pop-ups...the base navbar i can get to work fine, it's just the pop-up menus.
i'd post my code for it, but i got frustrated yesterday and deleted it and just
went with the pop-up menu i had previous. meh.
anyways, that's what i'm looking for, and i know that at least gary knows how
to make it.....i'm sure it can't be THAT difficult, but i'm at a loss....t's
been a long week and my brain hurts.
thanks in advance
christoff
|
| John Gaver replied to christoff915 on 16 Jul 2004 |
What he is using is not tables, but CSS. Take a look at his CSS file. Look
for ".menu". The key is setting "block". I think that it should work in
tables, but I've never tried. Use CSS. Much easier. Once you have defined
the style, adding a new menu item is as easy as adding a new
<p><a href="...">paragraph text</a></p>.
That's the same thing that I used, without the slide out menus, at:
http://www.megafolia.com/
Fast and easy.
John Gaver
Action America
(forget everything to contact me direct)
Microsoft: (n) Job security for IT consultants.
|
| Murray *TMM* replied to christoff915 on 16 Jul 2004 |
(inline styles shown for clarity)
<td><a href="foo.html" style="display:block">This entire cell will be
clickable<a></td>
|
|