|
|
|
making table cells into links |
| message from christoff915 on 15 Jul 2004 |
hola,
i'm looking for a tutorial on how to make your table cells into links for my
drop-down menu. it's a pretty common thing, and i have seen a few snippets here
and there for the css code and other stuff, but i can't seem to get it to work.
can anyone point me to a tutorial for this? much appreciated if you can.
thanks
christoff
|
| Murray *TMM* replied to christoff915 on 15 Jul 2004 |
What browser support do you want to consider?
|
| John Gaver replied to Murray *TMM* on 16 Jul 2004 |
Murray, as I said, it is a kludge. Also, for the link to stay within the
boundaries of the table, it MUST be enclosed in a cell of another table,
which is what the original question referred to.
Try this.
<table width="610" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<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>
</td>
</tr>
</table>
In most browsers, this gives the effect of making the whole table within the
cell a link, without the hot area extending beyond the cell. It's a kludge.
But, when implemented as stated, there are only a couple of browsers that
don't give the exact desired effect. I used to use that, before CSS became
available.
In fact, I even used it recently, on a site that is still using an old,
pre-CSS, tables-based template, to make all of a sliced photo that was
included in a table hot. The reason for slicing the photo into the table,
was because I removed three cells, in the middle and replaced them with a
counter, that can be easily updated, since it changes every few days and I
don't have the time to deal with redoing the graphics. If you care to see
it, it's at:
http://www.ActionAmerica.org/houston/index.html
That site is built on an old tables template that I just have not had time
to update. Even so, for what it is, it works. It has taken as many as
407,000 hits in a single month. That page is always about the third or
fourth most popular. The counter, with the train photo, is the linked table.
The link actually extends out to the edge of the containing cell, but the
distance is short, so I didn't bother to put it in another table. After all,
that is a spare time site.
Also, look at the JavaScript "Crash Clock", on that page. When JS is
enabled, you see the number of hours since the last crash. Turn JS off and
reload and you see a gray text message, telling you what you are missing.
Whenever I use JS, if possible, I either make it transparent to non-JS
browsers or give them a polite message. Sometimes, you can't avoid it, so I
tell them in advance, as on the "Fun Stuff" menu, where I link to some JS
electronic ballots, which I hope to find the time to update before the next
election.
Like I said, it's a spare time site, so I get to play with it in different
ways. OTOH, because of the growing popularity of the site, I have recently
begun working on a new site design. I expect another big bump in hits next
week, since the site will be mentioned in an Associated Press article that
is expected to go national. I find it amazing that so many people want to
read what I write. I guess there's just no accounting for taste. 8^)
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 |
Oops. I see. It's a kludge, allright.
|
|