Jump to content

[SOLVED] Text not showing up right


BrandonE97

Recommended Posts

We'd need to see more than one declaration, i.e. let's see some of the html code.  I assume your stuff is in a table.  By default, td content is vertically aloigned in the moddle of the cell.  Wonder if that's anything to do with it?

Link to comment
Share on other sites

Are you floating anything? FF and IE7 do an excellent job of knowing where to position if you're using 2 columns with float. For some reason, if you don't also float the right side, IE6 will push what's in the right column far enough down so that all the left column data is above it.

 

Might not apply, but I've had that happen and it's an easy fix.

Link to comment
Share on other sites

<body>
<table cellpadding="0" cellspacing="0">
<tr>
<td valign="top" rowspan="2" width="115">
<?php include("navmenu.php"); ?>
</td>
<td valign="top" height="75" class="title">IP Info</td>
</tr>
<tr>
	<td id="body" valign="top">
	Check your IP address here<br />
	<span class="spgreen">
	<?php
	echo('IP: '.$_SERVER['REMOTE_ADDR']);
	?></span><br />
</td>
</tr>
</table>
</body>

Link to comment
Share on other sites

td.title {

width:545px;

height:75px;

font-size:46px;

text-align:center;

text-decoration:underline;

font-weight:bold;

}

 

I removed the height from the html since I should probably keep that in the css doc. As far as what is pushing the text down I have no idea how to fix that.

Link to comment
Share on other sites

I don't know much about tables for layout but it seems like you have one tr row that contains the navigation and the header IP INFO, then you create a new tr that contains the actual ip info.  If you think about it, that first tr is going to expand to the height of the nav on the left since it contains that td, so the next tr will come below that. and it looks like the ip address comes immediately after the height of the nav on the left.  Maybe try moving the ip information into the td that contains the ip header.  Again I don't really know tables that well but that's what it seems like to me.  

Link to comment
Share on other sites

I don't know much about tables for layout but it seems like you have one tr row that contains the navigation and the header IP INFO, then you create a new tr that contains the actual ip info.  If you think about it, that first tr is going to expand to the height of the nav on the left since it contains that td, so the next tr will come below that. and it looks like the ip address comes immediately after the height of the nav on the left.  Maybe try moving the ip information into the td that contains the ip header.  Again I don't really know tables that well but that's what it seems like to me. 

 

Your assessment is wrong. He's using rowspan on the very first td. From a GENERAL standpoint, the first table has 3 cells. 2 in the first row and 1 in the second. The first cell in the first row (the navigation) uses rowspan='2' so he doesn't need 2 cells in the second row. the first cell is "there" because the first cell in the first row takes up that space. The second cell in teh 2nd row will not start at the bottom of the nav cell.

Link to comment
Share on other sites

Anytime I use the css code it shows up half way down the screen:

td#body {
vertical-align:top;
text-align:center;
width:555px;
height:auto;
padding:10px;
}

but when I take away the id="body" and put a width and height in the code it shows up correctly and my content is right under the page title.

<body>
<table cellpadding="0" cellspacing="0">
<tr>
<td valign="top" rowspan="2">
<?php include("navmenu.php"); ?>
</td>
<td class="title">IP Info</td>
</tr>
<tr>
	<td id="body">
	Check your IP address here<br />
	<span class="spgreen">
	<?php
	echo('IP: '.$_SERVER['REMOTE_ADDR']);
	?></span>
	</td>
</tr>
</table>
</body>

So any ideas as to what is wrong, I cant figure it out. Thanks for any help and the help of those that have already replied.

Link to comment
Share on other sites

It's surely this line:

<td class="title">IP Info</td>

--the browser is making that cell tall, it equals "height of left rowspanned td" minus "height of bottom right td"

-solution: get rid of rowspan and just make it a 2 col, 1 row table:

<table cellpadding="0" cellspacing="0">
    <tr>
        <td valign="top">
             <?php include("navmenu.php"); ?>
        </td>
        <td id="body">
            IP Info<br />
            Check your IP address here<br />
            <span class="spgreen">
<?php
echo('IP: '.$_SERVER['REMOTE_ADDR']);
?></span>
        </td>
    </tr>
</table>

Link to comment
Share on other sites

Here is the title css:

td#title {
width:555px;
height:75px;
vertical-align:top;
font-size:46px;
text-align:center;
text-decoration:underline;
font-weight:bold;
}

I figured the height would fix my problem. Firefox still renders it correctly lol. Thanks for everyones help.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.