homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Gold Sponsor 2015!
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Paragraph displays on the right and not centered.

Msg#: 4523548 posted 11:56 am on Nov 29, 2012 (gmt 0)

On my about.php page... my paragraph displays on the right hand side and not centered. Here is my script, minus the paragraph.

<table class="mainBodyTable" border="0" align="center" cellpadding="0" cellspacing="0">
<td width="700" valign="top">
<div align="center">
<table width="100%" align="center" cellpadding="5">

<table width="100%" align="center" cellpadding="6">
<td width="100%"><p align="left">Welcome

<p align="left">

<p align="left">

<p align="left">

<p align="left">&nbsp;</p>
<p align="left">See you soon.</p>
<p align="left">Thank you,</p></td>
<?php include_once "footer.php"; ?>



WebmasterWorld Senior Member 5+ Year Member

Msg#: 4523548 posted 12:36 pm on Nov 29, 2012 (gmt 0)

its probably because it's in a <td> cell. try putting text-align:left on the td cells

you really need to get rid of all the tables though. if all you've got is a few <p>s in them, then there's no need for 3 nested tables and a <div>. it looks like you are using empty <p>s for line-breaks too. you should try switching to <br> instead

i would scrap the whole lot and just use <p>s. it will cut your code down and be a lot easier to style


WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

Msg#: 4523548 posted 9:33 pm on Nov 29, 2012 (gmt 0)

The very first thing in your HTML is <table class = "blahblah"> implying that you've got a stylesheet somewhere. But then it seems to evaporate and it's all "align=" from there on.

On some browsers
<div align="center">
will override default settings for everything inside the div. Don't use it. In fact, scrap the div.

you should try switching to <br> instead

Or define a paragraph class with a bigger top margin. Or spacing between adjacent paragraphs, like
td p + p {margin-top: something-bigger-here;}
if you don't want the first paragraph to have extra room at the top.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved