Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

HTML problem in IE, please help (colspan).

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
NamecheapNamecheap
Watch

yuppie

Established Member
Impact
3
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?
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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>
 
0
Close
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.
 
0
Close
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.
 
0
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back