[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 10-12-2006, 03:51 AM   #1 (permalink)
NamePros Regular
 
yuppie's Avatar
 
Join Date: Apr 2006
Location: http://www.teamtesting.com
Posts: 542
1,434.00 NP$ (Donate)

yuppie has a spectacular aura aboutyuppie has a spectacular aura about


HTML problem in IE, please help (colspan).

Please open the below code in IE and FF.

Code:
<html>
<body>
   <table style="width:50%; border-collapse:collapse;" border="1">
	<tr style="height:25px;">
	    <td>data</td>
            <td style="width:70px;">data2</td>
	</tr>
        <tr style="height:25px;">
	    <td colspan="2" bgcolor="#CCCCCC" align="right">A very long footer name, longer than 70px;</td>
	</tr>
   </table>
</body>
</html>
As you can see FF shows the right column correctly (its width=70px), whereas IE ignores "width" property and extends the column width

If you set the footer text to something like "Test", then both browsers behaves as expected.

Does anybody have a solution to this?
yuppie is offline  
Old 10-12-2006, 05:28 AM   #2 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
 
Join Date: Feb 2006
Posts: 2,801
56.00 NP$ (Donate)

Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future

Autism Autism Autism Autism Autism Autism Autism
Code:
<html>
<body>
   <table style="width:50%; border-collapse:collapse;" border="1">
	<tr style="height:25px;">
	    <td>data</td>
            <td style="width:70px;">data2</td>
	</tr>
        <tr style="height:25px;">
			<td></td>
			<td colspan="2" bgcolor="#CCCCCC" align="right" style="width: 70px;">A very long footer name, longer than 70px;</td>
		</tr>
   </table>
</body>
</html>
Dan is offline  
Old 10-12-2006, 05:53 AM   #3 (permalink)
NamePros Regular
 
yuppie's Avatar
 
Join Date: Apr 2006
Location: http://www.teamtesting.com
Posts: 542
1,434.00 NP$ (Donate)

yuppie has a spectacular aura aboutyuppie has a spectacular aura about


Dan,

Your solution doesn't work:
1. I don't understand for what you put empty "<td></td>" in the footer
2. Adding "width:70px;" to the footer style helps to keep the proper width of the "data" cell, but the footer itself becomes splitted in several lines, since it's width becomes exacty 70px, but I need the width of the footer be as long as the table itself.
yuppie is offline  
Old 10-12-2006, 08:45 AM   #4 (permalink)
NamePros Member
 
xemiterx's Avatar
 
Join Date: Dec 2003
Location: Oregon
Posts: 110
203.25 NP$ (Donate)

xemiterx is on a distinguished road


Some ideas

If you loose the 50% width of the table and go to a fixed width (say 600px) and then specify a width for the first cell (530px in this example) that would work.

Or, keep the 50% width, and set the width of the first cell to 100%. That will make the data2 cell shrink below 70px, to keep that from happening you would have to insert a 70px wide image in the data2 cell.

Not using tables and using pure css is probably the best answer.

Good luck.
xemiterx is offline  
Closed Thread


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

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 11:56 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85