473,386 Members | 1,819 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.

Click in a <TD> tag

Hello!

I have a table with several rows with text. I want to make the complete cell
(or row) clickable as a link/href.
Writing <a href...><td>bla bla</td></a> is not possible.

If this is possible I have to add several spaces to the text (bla
) to make the clickable area larger.
If I have to do this, how to disable the feature that formats the text as a
link (becames blue and underlined).

How to solve this? Please don't make me create pictures for all cells.
Regards Magnus
Nov 19 '05 #1
5 4575
Hi magnus,
1)You can try to place a div inside the td with width and height 100% and
use the onclick of the div tag.
<table><tr><td width="100" height="100">
<div onclick="javascript:alert('h')" style = "width:100;height:100">bla
bla</div>
</td></tr></table>
or
2)You can use a style sheet to cancel the formatting for the hyperlinks and
make them appear as plain text.
--
HTH
srini
http://www.expertszone.com
"Magnus Blomberg" wrote:
Hello!

I have a table with several rows with text. I want to make the complete cell
(or row) clickable as a link/href.
Writing <a href...><td>bla bla</td></a> is not possible.

If this is possible I have to add several spaces to the text (bla
) to make the clickable area larger.
If I have to do this, how to disable the feature that formats the text as a
link (becames blue and underlined).

How to solve this? Please don't make me create pictures for all cells.
Regards Magnus

Nov 19 '05 #2
<td>
<a href=# style="width:100%;text-decoration:none;">blah</a>
</td>

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Magnus Blomberg" wrote:
Hello!

I have a table with several rows with text. I want to make the complete cell
(or row) clickable as a link/href.
Writing <a href...><td>bla bla</td></a> is not possible.

If this is possible I have to add several spaces to the text (bla
) to make the clickable area larger.
If I have to do this, how to disable the feature that formats the text as a
link (becames blue and underlined).

How to solve this? Please don't make me create pictures for all cells.
Regards Magnus

Nov 19 '05 #3
You have to use JavaScript for this type of action, as you cannot surround a
table cell with a anchor tag (a href="").

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Magnus Blomberg" wrote:
Hello!

I have a table with several rows with text. I want to make the complete cell
(or row) clickable as a link/href.
Writing <a href...><td>bla bla</td></a> is not possible.

If this is possible I have to add several spaces to the text (bla
) to make the clickable area larger.
If I have to do this, how to disable the feature that formats the text as a
link (becames blue and underlined).

How to solve this? Please don't make me create pictures for all cells.
Regards Magnus

Nov 19 '05 #4
<td onclick="alert('Thanks for the click.');" style="cursor: pointer;">some
text</td>

Ray at work

"Magnus Blomberg" <ma*************@skanska.se> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello!

I have a table with several rows with text. I want to make the complete
cell
(or row) clickable as a link/href.
Writing <a href...><td>bla bla</td></a> is not possible.

If this is possible I have to add several spaces to the text (bla
) to make the clickable area larger.
If I have to do this, how to disable the feature that formats the text as
a
link (becames blue and underlined).

How to solve this? Please don't make me create pictures for all cells.
Regards Magnus

Nov 19 '05 #5

Thanks everyone! It helped me!
Regards Magnus
*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #6

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

Similar topics

3
by: Matt Adams | last post by:
I want to move the following <PRE> defintion to a css file: <TABLE><TR><TD><PRE>sample text</PRE></TD> <TD> not predefined font</TD></TR></TABLE> should be <TABLE><TR><TD class=aaa>sample...
2
by: js | last post by:
I have a table rendered with XSLT. The first column has a radio button controls for user to make a selection for a particular row. All the values in the remaining columns are all concated with a...
2
by: bissatch | last post by:
Hi, I am trying to use JavaScript to write a table column on a web page. The code is as follows: <html> <head> <script> function displaycount() {
3
by: RC | last post by:
I have a very sime html table like <html><head><title>My Table</title> <style> input { margin: 0; padding: 0; border-width: 0; text-indet: 0; text-align: left } </style></head><body> <table...
3
by: Henry Johnson | last post by:
Okay - I'm spinning my wheels on this one... can someone help me figure out how to programmatically populate a table cell as follows (from C# code-behind)? I've tried using a Literal control in the...
2
by: petereffect | last post by:
i have foll. code <tr> <a href="a1.shtml"> <td width='100%'> &nbsp;"+Testing+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td> </a>
4
George Lft
by: George Lft | last post by:
I'm new at building table. Mostly PHP programming . Now I can't seem to fix the size of my table row and column. Any idea? <h4>Two rows and three columns:</h4> <table border="1"> <tr> ...
7
by: Xiaoyan | last post by:
Hi,everyone: I have a problem now. I can't get the information between the <tr><td> and </td></tr>. for example: I use this regular expression can't get it, I don't know why....
4
by: harryusa | last post by:
I am trying to center 2 images concentrically which are z-indexed to lay on top of each other making an image with a border from another image that has a transparent center. I need the images to be...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.