473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

make a table a link without javascript?

In several of my pages I need to show an area with a background image
and HTML text in certain places. The restrictions I have is that I
can't use javascript or CSS positioning like 'float', so I did it with
a table.
I then tried <a href="..."><table ...>...</table></a and it worked in
Firefox but not in IE. I then found out that <tableshouldn't go
inside <a>. So I put the <a href="..."inside every <tdin the table,
but it doesn't cover the whole area for some reason.
This is the actual code (just removed stuff to make it smaller/clearer)
<table cellspacing="0" cellpadding="0"
style="background-image:url(upper_image.jpg)">
<tr><td colspan="3"><a href="..."><img src="blank.gif" alt=" "
width="217" height="10" border="0"></a></td></tr>
<tr valign="top">
<td><a class="nulink" href="..."><img src="blank.gif" alt=" "
width="1" height="2 05" border="0"></a></td>
<td width="124" align="center">
<table cellspacing="0" cellpadding="0" style="margin-top:5px">
<tr><td align="center"><a href="..."><span>text</span></a></td></tr>
<tr><td><a href="..."><img src="blank.gif" alt=" " width="1"
height="10" border="0"></a></td></tr>
<tr><td align="center" width="124"><a href="..."><span
class="ad6">text </span></a></td></tr>
<tr><td align="center" width="124"><a href="..."><span
class="ad6">text </span></a></td></tr>
<tr><td align="center" width="124"><a href="..."><span
class="ad6">text</span></a></td></tr>
</table>
</td>
<td><a href="..."><img src="blank.gif" alt=" " width="92" height="1"
border="0"></a></td>
</tr>
</table>

The problem is that the only clickable area is where the text is, not
the area below it. The table has 2 columns, one is a 205 px high line
so the image shows complete, the second column is a new table with the
actual text, problem is that the table doesn't cover the whole height
(205px) so the area below it is not clickable. I guess I can put
another row in this table with an image that covers the area, but
what'd happen if the user made the text larger? it'd probably push this
image down and screw the layout.
Not sure what to do here.

Aug 8 '06 #1
3 8707

wo******@gmail.com wrote:
I then tried <a href="..."><table ...>...</table></a and it worked in
Firefox but not in IE. I then found out that <tableshouldn't go
inside <a>.
Did you post this a week or two ago, or was it someone else with the
same question?

Put <a href="..." >...</ainside one or more <td>

Use JavaScript to make the whole table a clickable link, using an
onclick event handler.

It works as you want for most people with JS, and the non-JS fallback
is acceptable.

Aug 8 '06 #2

Andy Dingley wrote:
wo******@gmail.com wrote:
I then tried <a href="..."><table ...>...</table></a and it worked in
Firefox but not in IE. I then found out that <tableshouldn't go
inside <a>.

Did you post this a week or two ago, or was it someone else with the
same question?
no wasn't me, but for some reason I didn't see that question when I
searched
Put <a href="..." >...</ainside one or more <td>

Use JavaScript to make the whole table a clickable link, using an
onclick event handler.

It works as you want for most people with JS, and the non-JS fallback
is acceptable.
yeah that's kinda like what I was doing (except for the javascript for
those with javascript enabled). Was thinking maybe there was something
I could do like height="100%" or something but don't think that works
or if it's even universally supported.
Thanks

Aug 8 '06 #3
wo******@gmail.com wrote:
In several of my pages I need to show an area with a background image
and HTML text in certain places. The restrictions I have is that I
can't use javascript or CSS positioning like 'float', so I did it with
a table.
I then tried <a href="..."><table ...>...</table></a and it worked in
Firefox but not in IE. I then found out that <tableshouldn't go
inside <a>. So I put the <a href="..."inside every <tdin the table,
but it doesn't cover the whole area for some reason.
Because of margins, padding, etc.

Regarding getting an A to fill up a space, find some tips at

http://www.alistapart.com/articles/slidingdoors/

and the follow-up article,

http://www.alistapart.com/articles/slidingdoors2/
Aug 8 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i...
1
by: Robert | last post by:
I created two pages. One using CSS and the other using a table. I'd like the css version to work like the table version. The problem arises when the full image doesn't fit in the window. Click...
31
by: Royal Denning | last post by:
I am designing a table with 2 columns and 20 rows. I want to insert small images (each with a link) and a text title in each cell of the table. On refresh of the page, I would like to have the...
0
by: Gianfranco | last post by:
Hi I got a problem with 2 tables. I have a table, say A, with x records, coming from a make table query and a table, say B, with y records, coming from another make table query. I need to join...
10
by: Luke | last post by:
Hi. I am trying to make correct layout, here is an example of (dynamically generated content via jsp): http://localhost/www/layout.htm Most outer div is positioned absolute (if not then it...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
0
by: Romulo NF | last post by:
I´ve recently posted a script to move columns from a table using drag and drop javascript. Recently i´ve received a message of a user of this communty showing interest in the script to move lines...
4
by: Jim Devenish | last post by:
I wish to copy a table on a SQL Server backend to a table on an Access (.mdb) front end in the simplest way. I have the following to get the recordset but am seeking something easier. Dim...
20
by: Prisoner at War | last post by:
Hi, People, Is it possible to have an "empty" or "dummy" <a href***without*** the browser jumping back up the page?? I have a hyperlink that doesn't point to another document, but is used to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.