User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 392,076 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,053 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 1574 | Replies: 1
Reply
Join Date: Oct 2006
Location: somewhere in West-Africa
Posts: 196
Reputation: jamello is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 6
jamello's Avatar
jamello jamello is offline Offline
Junior Poster

Help table cells and hyperlinks!

  #1  
Nov 1st, 2006
I would like a table cell to act as my hyperlink. What I have currently is a hyperlink embedded in a table cell, hence it is only when the exact underlined hyperlink text is clicked that the url is obeyed. But not when you click anywhere else. [e.g <tr><td><a href=www.meme.com>clickMe </a></td></tr>]
In the example, the url only works where I click on "Click Me" and not anywhere on the table cell. Please, a helping hand is needed.
Last edited by jamello : Nov 1st, 2006 at 10:34 am.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2006
Location: Sofia, Bulgaria
Posts: 135
Reputation: Rhyan is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 7
Rhyan's Avatar
Rhyan Rhyan is offline Offline
Junior Poster

Re: table cells and hyperlinks!

  #2  
Nov 1st, 2006
Originally Posted by jamello View Post
I would like a table cell to act as my hyperlink. What I have currently is a hyperlink embedded in a table cell, hence it is only when the exact underlined hyperlink text is clicked that the url is obeyed. But not when you click anywhere else. [e.g <tr><td><a href=www.meme.com>clickMe </a></td></tr>]
In the example, the url only works where I click on "Click Me" and not anywhere on the table cell. Please, a helping hand is needed.


Hi there.

If you try to code it like this :
<table><tr><a><td>My link here</td></a></tr></table>

your code may not validate, or result in another error.

Do you have something else apart from text link inside your cell?

In case you have some short text, e.g. "Click here" and your cell is wither or higher than this text, you can make one of the following:

Case 1 - your text is wide as wide as the cell is, however it is not that high - you can set it like this with css:
[HTML]...<td style="line-height: 50px; font-size: 12px;"><a href="#"> Click me! </a></td>...[/HTML]

In this way, if your cell is 50px high, and your text size is 12px, wherever you point your cursor - it will change as a link pointer.

Case 2
Well - it si more complex, and if you have any other elements in this cell, like images, additional text, etc. it may turn to be a problem, still you can try it. You can set the following css to your link:
[HTML]...<a href="#" style="display: block; width: 100px; height: 50px;">Click me!</a>....[/HTML]

Try it and advise...
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb HTML and CSS Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the HTML and CSS Forum

All times are GMT -4. The time now is 12:13 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC