Click to See Complete Forum and Search --> : center text problem


evania
12-25-2007, 07:29 AM
im unsure if this is right for the HTML thread, but since it's a HTML problem im posting here.

i have this code bellow where im trying to center the text from <? include 'includes/toptoday.php'; ?> it works in firefox but when i try to force it center so it's also centerd in Internet explorer it wont work and wont center itself while all other test / include files are centerd, anyone know why ? :/

<div align="center">

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="820">
<tr>
<td width="820"><? include 'header.php'?><br>

<table class="body1" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="820">
<tr>
<td width="820"><center>Tip: <i><br>Here is a list of the top users for today!</center><br><br><center><? // include 'includes/userpanel.php'?></center><center><? include 'includes/toptoday.php'; ?><br><br></td></center>
</tr>
</table><center>
<?/****/ include 'includes/footer.html'; ?>
<br><br></td>
</tr>
</table>
</div>
</center>

ryanbutler
12-25-2007, 09:57 AM
Hard to say without all the code, but you shouldn't need to use <center> at all. Use center on the <td> tag containing the include.

evania
12-25-2007, 10:01 AM
Hard to say without all the code, but you shouldn't need to use <center> at all. Use center on the <td> tag containing the include.

bellow is the code from the php file, before it there is a mysql query and this code comes after it, then there is nothing more. i cant figure out why it wont center in IE! :/

<? if ($added=="false") { ?><td width="70"

align="center">
<a target="_blank" class="add" href="<? echo

PROFILE_ADD . $rowsSet['fid']?>"><img class="picture" src="<? echo

IMAGE_PATH.$rowsSet['image']?>"></a><br> <a target="_blank" class="add" href="<? echo PROFILE_ADD .

$rowsSet['fid']?>"><b>Add</b></a> | <a target="_blank" class="add" href="<? echo PROFILE_VIEW .

$rowsSet['fid']?>"><b>View</b></a><br>
<? // echo $rowsSet['dname']?>
Points: <strong><? echo

$rowsSet['today_points']?><br></strong><? } ?></td>

evania
12-25-2007, 12:23 PM
i forgot to add that <? include 'includes/toptoday.php'; ?> is the only file that do not line up, can anyone se why just that one would not line up in the codes above ? :(

WebJoel
12-25-2007, 03:19 PM
...<? include 'includes/toptoday.php'; ?>...( -Educate me: I thought server-side includes were written more like <!--#include virtual="/footer.php" -->, etc... I really don't know. :confused:

ryanbutler
12-26-2007, 02:26 PM
can anyone see why just that one would not line up in the codes above ?

No. Can you give us an example of the output, such as a URL to a web page?

-Educate me: I thought server-side includes were written more like <!--#include virtual="/footer.php" -->, etc... I really don't know.

Your include is for ASP. He's trying to call an include using the PHP method.

Major Payne
12-26-2007, 04:29 PM
PHP Include: <?php
include("/path/to/your/included/files/somefile.php");
?>

ASP Include: <!--#include virtual="somefilename"-->

or

<!--#include file ="somefilename"-->

I think I got this straight now. :D

Ron

WebJoel
12-26-2007, 06:37 PM
<!--#include virtual="somefilename"--> -Doesn't this need to be 'whitespace-->'? ( " -->" )

I've really go to learn all this. :D

Major Payne
12-26-2007, 07:11 PM
Not sure if it would make a difference or not, but I do use it the way you indicated with whitespace. Actually used on one of my root directory pages: <!--#include file="a_head_tags2.html" -->

Will try it both ways when I get time to see if it will work. I've still got so much to learn and not enough time left to do so.

Ron

ryanbutler
12-27-2007, 10:32 AM
Whitespace shouldn't make a difference in the ASP world. I've never had a problem with it in the PHP world either that I can recall.

Major Payne
12-27-2007, 07:24 PM
Thanks. Will save me from testing it. LOL

Ron