To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Misc Help > ClientSide Technologies

ClientSide Technologies Discuss HTML/CSS/Javascript, and any other client-side technologies, here.

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-30-2006, 07:19 AM   #1
methatron
Junior Member
 
Join Date: Apr 2004
Posts: 2
an HTML problem, not PHP

I have this really annoying problem with HTML tables I cant solve.
if you can, paste this code and run it somewhere and see what my problem is.
(I want the red TD's to be indeed 1px wide in the 2nd table as well).
the img is just a 1x1 transparent-pixel image so the TD wont be empty.
Thanks in advance.

code ->

<body>
<br><br>
<center>
why here the red TD's are indeed 1px wide
<table border="1" cellspacing="0" cellpadding="0" width="80%">
<tr>
<td style="width:1px; background-color:red;"><img src="/images_n/tp.gif" alt="" height="15" width="1"></td>
<td colspan="3" style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
<td style="width:1px; background-color:red;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
</tr>
<tr>
<td colspan="2" style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="15" width="1"></td>
<td style="background-color:aqua;"><img src="/images_n/tp.gif" alt="" height="1px" width="1"></td>
<td colspan="2" style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
</tr>
</table>
<br><br>
why here the red TD's are NOT 1px wide
<table border="1" cellspacing="0" cellpadding="0" width="80%">
<tr>
<td style="width:1px; background-color:red;"><img src="/images_n/tp.gif" alt="" height="15" width="1"></td>
<td style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
<td style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
<td style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
<td style="width:1px; background-color:red;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
</tr>
<tr>
<td style="width:1px; background-color:red;"><img src="/images_n/tp.gif" alt="" height="15" width="1"></td>
<td colspan="3" style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
<td style="width:1px; background-color:red;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
</tr>
<tr>
<td colspan="2" style="background-color:black;">a</td>
<td style="background-color:aqua;">b</td>
<td colspan="2" style="background-color:black;">c</td>
</tr>
</table>
</center>
</body>
methatron is offline   Reply With Quote
Old 03-30-2006, 07:32 AM   #2
TF@TheMoon
Knights of the Magical Li
 
TF@TheMoon's Avatar
 
Join Date: Mar 2006
Posts: 109
is your path to the images correct. You can fix it by adding a &nbsp; to the 2nd table first row, columns 2-4. Its not clean though, and I'm too hungry to think fo the correct solution
TF@TheMoon is offline   Reply With Quote
Old 03-30-2006, 07:50 AM   #3
methatron
Junior Member
 
Join Date: Apr 2004
Posts: 2
the image path is correct
and adding &nbsp; wont make the red TD's 1 pixel wide
methatron is offline   Reply With Quote
Old 03-30-2006, 09:57 PM   #4
Weedpacket
Custom User Title™
 
Weedpacket's Avatar
 
Join Date: Aug 2002
Location: Rapid Offensive Unit "Foreign Object Damage"
Posts: 19,128
And moving this to a more appropriate forum.
__________________
On two occasions I have been asked [by Members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
Weedpacket is offline   Reply With Quote
Old 03-31-2006, 09:10 AM   #5
michaewlewis
Senior Member
 
Join Date: Feb 2006
Posts: 118
they both are 1 px in Konqueror browser, and in FF the red columns in the top table are 2 px and the bottom ones are 1 px. Must be a bug in IE causing it to make it 200 px or whatever the dimension is.
Perhaps you could try nesting tables instead of using colspan.

HTML Code:
Table 1:
<table border="0" cellspacing="0" cellpadding="0" width="80%">
  <tr>
    <td>
    <table style="border-bottom-style:none;" width="100%" cellspacing="0" cellpadding="0" border="1">
      <tr>
        <td style="width:1px; background-color:red;"><img src="/images_n/tp.gif" alt="" height="15" width="1"></td>
        <td style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
        <td style="width:1px; background-color:red;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td>
    <table width="100%" cellspacing="0" cellpadding="0" border="1">
      <tr>
        <td style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="15" width="1"></td>
        <td width="60%" style="background-color:aqua;"><img src="/images_n/tp.gif" alt="" height="1px" width="1"></td>
        <td style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
      </tr>
    </table>
    </td>
  </tr>
</table>

<br>
Table 2:
<table border="0" cellspacing="0" cellpadding="0" width="80%">
  <tr>
    <td>
    <table style="border-bottom-style:none;" width="100%" cellspacing="0" cellpadding="0" border="1">
      <tr>
        <td style="width:1px; background-color:red;"><img src="/images_n/tp.gif" alt="" height="15" width="1"></td>
        <td style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
        <td style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
        <td style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
        <td style="width:1px; background-color:red;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td>
    <table style="border-bottom-style:none;" width="100%" cellspacing="0" cellpadding="0" border="1">
      <tr>
        <td style="width:1px; background-color:red;"><img src="/images_n/tp.gif" alt="" height="15" width="1"></td>
        <td style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
        <td style="width:1px; background-color:red;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td>
    <table width="100%" cellspacing="0" cellpadding="0" border="1">
      <tr>
        <td style="background-color:black;">a</td>
        <td style="background-color:aqua;">b</td>
        <td style="background-color:black;">c</td>
      </tr>
    </table>
    </td>
  </tr>
</table>
__________________
CPU, AGP, SQL, PHP.... what is this language those young people keep speaking? What does it all mean!?

Last edited by michaewlewis; 03-31-2006 at 09:39 AM.
michaewlewis is offline   Reply With Quote
Old 03-31-2006, 11:52 AM   #6
nc_phpguy
Junior Member
 
Join Date: Mar 2006
Posts: 5
I wouldnt use Style attributes to specify width for tables. It can cause issues between browsers. The 1st table was easy, the 2nd table is a bit trickier. If you know the absolute width of the table you can code it like i did below. Hope this points you int the right direction.

nc_phpguy

--------------

<body>
<br><br>
<center>
why here the red TD's are indeed 1px wide
<table border="1" cellspacing="0" cellpadding="0" width="80%">
<tr>
<td width="1" bgcolor="red"><img src="/images_n/tp.gif" alt="" height="15" width="1"></td>
<td colspan="3" style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
<td width="1" bgcolor="red"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
</tr>

<tr>
<td colspan="2" style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="15" width="1"></td>
<td style="background-color:aqua;"><img src="/images_n/tp.gif" alt="" height="1px" width="1"></td>
<td colspan="2" style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
</tr>

</table>
<br><br>
why here the red TD's are NOT 1px wide
<table border="1" cellspacing="0" cellpadding="0" width="500">
<tr>
<td width="1" bgcolor="red"><img src="/images_n/tp.gif" alt="" height="15" width="1"></td>
<td style="background-color:black;" width="166"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
<td style="background-color:black;" width="166"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
<td style="background-color:black;" width="166"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
<td width="1" bgcolor="red"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
</tr>
<tr>
<td width="1" bgcolor="red"><img src="/images_n/tp.gif" alt="" height="15" width="1"></td>
<td colspan="3" style="background-color:black;"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
<td width="1" bgcolor="red"><img src="/images_n/tp.gif" alt="" height="1" width="1"></td>
</tr>
<tr>
<td colspan="2" style="background-color:black;">a</td>
<td style="background-color:aqua;">b</td>
<td colspan="2" style="background-color:black;">c</td>
</tr>
</table>
</center>
</body>
nc_phpguy is offline   Reply With Quote
Old 04-01-2006, 12:02 AM   #7
Weedpacket
Custom User Title™
 
Weedpacket's Avatar
 
Join Date: Aug 2002
Location: Rapid Offensive Unit "Foreign Object Damage"
Posts: 19,128
If you're going to be using styles to adjust the size of the table, then what are all those tp.gifs for? There's no point using 21st century layout techniques if you're going to override them with 20th-century ones. How much of this table is even necessary, and how much of it can be eliminated by actually using CSS for more than just colouring-in?
__________________
On two occasions I have been asked [by Members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
Weedpacket is offline   Reply With Quote
Old 04-01-2006, 11:17 AM   #8
michaewlewis
Senior Member
 
Join Date: Feb 2006
Posts: 118
try using CSS layout instead CSS Zen Garden has some great examples
__________________
CPU, AGP, SQL, PHP.... what is this language those young people keep speaking? What does it all mean!?
michaewlewis is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 07:54 AM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.