Table cell height attributes in IE

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Table cell height attributes in IE

Post by Chris Corbyn »

Hi,

I'm having a bit of compatability prob with IE. I've constructed a site in tables with PHP which all works fine in Netscape. Some of my cells have specified sizes (some in % and others in fixed pixels).

Internet explorer seems to not understand the dimensions I am putting in and ignores them whereas netscape handles it fine.

I'm typically doing this

Code: Select all

echo '<table border="0" cellpadding="15" cellspacing="0" align="center" Width="100%" height="95%">';
echo '<tr>';
	echo '<td rowspan="3" bgcolor="#91C4F2" valign="top" width="220">';
		include('navbar.html');
	echo '</td>';
	echo '<td colspan="3" height="60" align="center" bgcolor="#2B53C5">';
		include ('logo.html');
	echo '</td>';
echo '</tr>';
echo '<tr>';
	echo '<td colspan="3" height="60" bgcolor=#D6E9FD valign="top">';
switch ($location) &#123;
	case 'index':
		include ('default.php');
	break;
                &#125;
	echo '</td>';
echo '</tr>';
echo '<tr>';
	echo '<td width="35%" bgcolor=#D6E9FD valign="top">';
switch ($location) &#123;
	case 'index':
		include ('mainleft.html');
	break;
                &#125;
	echo '</td>';
	echo '<td bgcolor=#D6E9FD>';
	switch ($location) &#123;
	case 'nok_a':
		include ('img/codeloader.php');
	break;
                &#125;
	echo '</td>';
echo '</tr>';
echo '</table>';
Any idea why explorer is ignoring my width and height attributes?

You can check it in both browsers at http://nitrotones.tk
if you want to see what I mean.

Thanks
Chambrln
Forum Commoner
Posts: 43
Joined: Tue Dec 02, 2003 10:45 am
Location: Oregon

Post by Chambrln »

Try making one of your cells height = 100%. Make it the one that has most of your content or the one that you want to have most of the white space.

That should increase your table to the full 95% height overall you are trying to achieve.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Its not just the height I'm struggling with. My menu on the left hand side (fixed width of 220 pixels) does not fit the same 220 pixel width in IE and navigator. For this reason the text is shifted onto more lines causing the entire table to stretch in height.

The cell with my logo in it (nitrotones.tk) seems to constantly change size depending on which page is being viewed too even though it is set at fixed height 60 pixels and the content in that cell never changes (i've not forgotten I have used cell padding of 15 px).

I'll try out setting some cells to 100% width/height although I don't get how a fixed width/heght cell should ever change size unless the content is too much.

Thanks :)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I've sorted it.

I never used to think that this attribute was entirely neccassary but it obviously is.

All of my height attributes and width attributes were interpreted for each cell only once I added rows=3 and cols=3 to the <table> tag.

Thanks for your help anyway. Much appreciated :-)
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

d11wtq, don't double-post. Thank you.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Sorry,

I realised i posted in the database forum when I meant to post in the PHP forum
Post Reply