JavaScript and client side scripting.
Moderator: General Moderators
dardsemail
Forum Contributor
Posts: 136 Joined: Thu Jun 03, 2004 9:02 pm
Post
by dardsemail » Mon Oct 25, 2004 8:46 pm
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))
{
if ($_SESSIONї'page'] == $pagerowї'contentPage'])
{
?>
<td valign="middle" style="vertical-align:middle" align="center" bgcolor="#B0BA91"><p><a href="content.php?section=<?php echo $pagerowї'contentSection'];?>
&subsection=<?php echo $pagerowї'contentPage'];?>&page=<?php echo $pagerowї'contentPage'];?>"><h6><font color="#FFFFFF"><?php echo $pagerowї'contentTitle']?></font></h6></a>
<?php
}
else
{
?>
<td valign="middle" style="vertical-align:middle" align="center"><p><a href="content.php?section=<?php echo $pagerowї'contentSection'];?>
&subsection=<?php echo $pagerowї'contentPage'];?>&page=<?php echo $pagerowї'contentPage'];?>"><h6><?php echo $pagerowї'contentTitle']?></h6></a>
<?php
}
?>
</td><?php } ?>
neophyte
DevNet Resident
Posts: 1537 Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota
Post
by neophyte » Mon Oct 25, 2004 9:49 pm
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 » Mon Oct 25, 2004 10:18 pm
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 » Thu Oct 28, 2004 2:43 pm
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 » Thu Oct 28, 2004 9:25 pm
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!