Problems with table layout...

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
dardsemail
Forum Contributor
Posts: 136
Joined: Thu Jun 03, 2004 9:02 pm

Problems with table layout...

Post by dardsemail »

Hi,

I'm trying to create a navigation bar generated from a query to MySQL using PHP. Everything works fine - except I can't seem to get the row in the table to look quite right. I'd like to have a fairly narrow row in height and I keep getting these big chunky rows. What am I doing wrong? I seemed to have been able to figure out PHP - but am having trouble with the basic HTML now!!!

Here's my code:

Code: Select all

<tr><?php while ($pagerow = mysql_fetch_array ($pageresult))
	&#123;
	if ($_SESSION&#1111;'page'] == $pagerow&#1111;'contentPage'])
		&#123;
		?>
		<td valign="middle" style="vertical-align:middle" align="center" bgcolor="#B0BA91"><p><a href="content.php?section=<?php echo $pagerow&#1111;'contentSection'];?>
		&subsection=<?php echo $pagerow&#1111;'contentPage'];?>&page=<?php echo $pagerow&#1111;'contentPage'];?>"><h6><font color="#FFFFFF"><?php echo $pagerow&#1111;'contentTitle']?></font></h6></a>
		<?php
		&#125;
		else
		&#123;
		?>
		<td valign="middle" style="vertical-align:middle" align="center"><p><a href="content.php?section=<?php echo $pagerow&#1111;'contentSection'];?>
		&subsection=<?php echo $pagerow&#1111;'contentPage'];?>&page=<?php echo $pagerow&#1111;'contentPage'];?>"><h6><?php echo $pagerow&#1111;'contentTitle']?></h6></a>
		<?php
		&#125;
	?>
		</td><?php &#125; ?>
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

umm

Post by neophyte »

I can tell with out seeing the finished loaded page. Here's a couple possiblities...

1. Navigation list is too long causing wraping.

2. Have you tried setting the "height" in the column tag. <td height="20"></td>
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

3) Maybe the font is too big. Or there is a white space in a larger font.
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

what is the cellpadding set to?


if your font is say, 10px high, and you declare the hight of the <td> to be 10px too, you would expect it to be 10px high, right?

but if you have the cellpadding set to 3px, the td will be 16px high, even though you told it to be 10px.


the line hight of your font can also do this

if your font is 10px high, and the line height is 14px, the td will always be at least 14px high.

maybe that helps...
dardsemail
Forum Contributor
Posts: 136
Joined: Thu Jun 03, 2004 9:02 pm

Post by dardsemail »

Hi,

Thanks so much for your responses. I actually solved this one. It was a problem with the settings on one of the CSS formatting tags. Its resolved now.

Thanks again!
Post Reply