Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #21 (permalink)  
Old August 4th, 2004, 05:23 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: Tehran, , Iran.
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

and again...
----
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
.dr {
    height: 100%;
    width: 100%;
    cursor: hand;
    border: 1px dotted #999999;
    white-space: nowrap;
}
</style>
</head>
<body>
<table width="600" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="500"><a href="#" class="dr">Mehdi</a></td>>
    <td > <a href="#" class="dr">Mehdi</a></td>
  </tr>
    <tr>
    <td ><a href="#" class="dr">Mehdi</a></td>
    <td > <a href="#" class="dr">Mehdi</a></td>
  </tr>

</table>
</body>
</html>
-----
****IMPORTANT 1*****
in this line I assign to width attribute,the maximum width,a cell could have.
****IMPORTANT 2*****
I didn't determine any value for width because I don't know it and here there is not any problem about whitespaces and....
Realy hope it was clear...;))

--------------------------------------------
Mehdi.:)
  #22 (permalink)  
Old August 4th, 2004, 06:04 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Either way, in all your examples, just the content is linked, not the entire cell.

The original poster wanted the entire cell or row to be clickable. You keep posting examples that just link the cell's content. That's fine in many circumstances, but not what the OP was after.

Even if you specify the width, as you did in your last example, not the entire cell but just the content is linked.

Maybe you should try out your own examples to see what I mean.

Cheers,

Imar
  #23 (permalink)  
Old August 4th, 2004, 06:23 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: Tehran, , Iran.
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

>>Either way, in all your examples, just the content is linked, not the entire cell.
NO,please make an attention,they are the same...
did you know why I put ' border="0" cellpadding="0" cellspacing="0" ' in my table tag because the content could be extended to all entire cell and so...
The content==The entire cell


--------------------------------------------
Mehdi.:)
  #24 (permalink)  
Old August 4th, 2004, 07:00 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're wrong. The content != The entire cell

Try this:
Code:
<table>
<tr>
  <td><a href="#">123</a></td>
</tr>
<tr>
  <td><a href="#">12345678901234567890</a></td>
</tr>
</table>
Hold your mouse next to the first 123 in the first row. Is the whitespace linked? No, it isn't, so the content is not the entire cell. The entire cell can be much wider than the content, because other content and other rows can make the column wider than the content it is holding.

Cheers,

Imar
  #25 (permalink)  
Old August 4th, 2004, 07:18 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: Tehran, , Iran.
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

where is the CSS??!!!!
chage it like below
----
<style>
.dr {
    height: 100%;
    width: 100%;
    cursor: hand;
    border: 1px dotted #999999;
}
</style>
<table border="0" cellpadding="0" cellspacing="0" >
<tr>
  <td ><a class="dr" href="#">123</a></td>
</tr>
<tr>
  <td><a class="dr" href="#">12345678901234567890</a></td>
</tr>
</table>
----

--------------------------------------------
Mehdi.:)
  #26 (permalink)  
Old August 4th, 2004, 07:36 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Did you test this example before you posted it? It doesn't work on my browser. The <a> will be 100% of its inner content, which results in the <a> being as large as "123", not 100% of the table cell.

You may get away with applying the .dr class to the table cell instead of the <a> tag, but that will get you into trouble as well, and for the following reasons:

1. First of all, it still doesn't result in a row select, but in a single cell select. You would need to repeat the <a> for each and every cell. The OP wanted full row select.

2. You're modifying the structure and appearance of the page, just to change some functionality. What if I don't want my <td> cells to be 100% because I need them to be 723px to fit in with the rest of my design?

3. Finally, the solution doesn't work with multiple rows. If you apply the 100% width to the cells, you'll get into troubles when you have multiple rows. Try this for fun to see what I mean:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <title>Untitled Document</title>
  <style type="text/css">
  .dr {
      height: 100%;
      width: 100%;
      cursor: hand;
      border: 1px dotted #999999;
  }
  </style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
  <td class="dr"><a href="#">123</a></td>
  <td class="dr"><a href="#">123</a></td>
</tr>
<tr>
  <td class="dr"><a href="#">12345678901234567890</a></td>
  <td class="dr"><a href="#">12345678901234567890</a></td>
</tr>
</table>
</body>
</html>
The table will now fill the entire browser window.

I am sure there are work arounds for these problems that eventually will more or less work,. but IMO, applying the behavior to the table row is much cleaner as, after all, you want to select a <tr> so why not attach the behavior you need to that row?

Cheers,

Imar
  #27 (permalink)  
Old August 4th, 2004, 08:31 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: Tehran, , Iran.
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

===========================================
>>What if I don't want my <td> cells to be 100% because I need them to be 723px to fit in with the rest of my design?
==========================================

=========================================
>>applying the behavior to the table row is much cleaner as, after all, you want to select a <tr> so why not attach the behavior you need to that row?
========================================
This example you told works ok but you can't change the width do you know why? ....
the answer of all these questions is that I didn't tell you to make your <TD> 100% it could have every value(i.e 723 px,12px,50%)but here you make your width of <a> tag 100%
I can accept only your first reason(I don't think even it could be a little problem)...
have you ever tried my example at all?!!!!!

--------------------------------------------
Mehdi.:)
  #28 (permalink)  
Old August 4th, 2004, 08:43 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yeah, I tried this example:

<style>
.dr {
    height: 100%;
    width: 100%;
    cursor: hand;
    border: 1px dotted #999999;
}
</style>
<table border="0" cellpadding="0" cellspacing="0" >
<tr>
  <td ><a class="dr" href="#">123</a></td>
</tr>
<tr>
  <td><a class="dr" href="#">12345678901234567890</a></td>
</tr>
</table>

Instead of a full cell select, the dotted border is placed around 123, and doesn't stretch the entire table cell. That's why I said it didn't work.


Imar
  #29 (permalink)  
Old August 4th, 2004, 11:30 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: Tehran, , Iran.
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

Let's go on this thread tomorrow(I don't have enough time now)
excuse me.I will answer you about 12 houers later....

--------------------------------------------
Mehdi.:)
  #30 (permalink)  
Old August 4th, 2004, 10:59 PM
Friend of Wrox
 
Join Date: Jul 2004
Location: Tehran, , Iran.
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

well,I'm back.

--------------------------------------------
Mehdi.:)




Similar Threads
Thread Thread Starter Forum Replies Last Post
How to associate table rows with hyperlink?[READ] user0b PHP How-To 1 July 30th, 2008 04:20 AM
How to create a Hyperlink based on Cell Contents chatguy Excel VBA 4 October 15th, 2007 09:43 PM
layers in table cell dearmisskat HTML Code Clinic 12 March 10th, 2007 04:46 AM
reading from a table cell? Atomsk Access VBA 2 September 28th, 2006 07:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.