homepage Welcome to WebmasterWorld Guest from 54.161.246.212
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Simple Tables issue - but confounding to moi
.... why doesn't the text align right?
Mr Bo Jangles

10+ Year Member



 
Msg#: 3507865 posted 2:55 am on Nov 18, 2007 (gmt 0)

Hi all,
Can anyone put me out of my misery and tell me why the date won't do as it's told and 'align right'! in it's cell.

(I know you don't have the images, and only an extract of the CSS, but even with the 'full kaboodle' it is the same. Just open the HTML code below and tell me why it is behaving like that..)

__________________________

<html>
<head>
<style>

table {
width: 170mm;
background : White;
border : 1px solid Black;
text-align : center;
border-collapse : inherit;
}

table.cheque{
width: 185mm;
border : 1px solid Black;
border-collapse : inherit;
}

</style>
</head>

<body>

<table class="cheque" COLS=3>
<tbody>
<tr VALIGN=MIDDLE>
<td WIDTH=65% ALIGN="LEFT"><p class="printimage"><img src="/img/matbanklarge.jpg" width="400"

height="100"></p>
</td>

<td WIDTH=5%> <p> &nbsp; </p></td>

<td WIDTH=30% ALIGN="RIGHT" NOWRAP><p><b>16th January, 2007</b></p> </td>
</tr>

<tr VALIGN=TOP>
<td WIDTH=65% ALIGN="LEFT" NOWRAP><p>Pay:&nbsp; &nbsp;<b> Acme Gardening </b></p><td>

<td ROWSPAN=5 WIDTH=5% ALIGN="LEFT">
<p class="screenimage"><img src="/img/notnegotiablesmall.gif" width="32"

height="150"></p></td>
<td WIDTH=30% ALIGN="MIDDLE" NOWRAP> <p> or bearer </p> </td>
</tr>

<tr VALIGN=MIDDLE>
<td WIDTH=65% ALIGN="LEFT"><p> the sum of: &nbsp; &nbsp; <b>Two hundred five dollars and twenty cents </b></p><td>
<td WIDTH=30% ALIGN="MIDDLE" NOWRAP> <p><b>$125,245.20 </b></p> </td>
</tr>

<tr VALIGN=MIDDLE>
<td WIDTH=65% ALIGN="LEFT"><p> &nbsp; </p><td>
<td WIDTH=30% ALIGN="LEFT"> <p> &nbsp; </p> </td>
</tr>

<tr VALIGN=MIDDLE>
<td WIDTH=65% ALIGN="LEFT"> <p>Company <b>
Maintenance services Inc </b> <td>
<td WIDTH=30% ALIGN="LEFT"> <p> &nbsp; </p> </td>
</tr>

<tr VALIGN=MIDDLE>
<td WIDTH=65% ALIGN="RIGHT"><p>_________________</p><td>
<td WIDTH=30% ALIGN="LEFT" NOWRAP> <p>________________</p> </td>
</tr>

</tbody>
</table>

<table class="cheque" COLS=3>
<tbody>

<tr VALIGN=MIDDLE>
<td WIDTH=20% ALIGN="MIDDLE" NOWRAP><p> &nbsp; </p><td>
<td WIDTH=60% ALIGN="MIDDLE" NOWRAP> <p class="micr"> 1237888 98737</p> </td>
<td WIDTH=20% ALIGN="MIDDLE" NOWRAP> <p> &nbsp; </p> </td>
</tr>

</tbody>
</table>
</body>
</html>

__________________________

 

tedster

WebmasterWorld Senior Member tedster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3507865 posted 3:17 am on Nov 18, 2007 (gmt 0)

The <p> element is further down the cascade and its style rules take over. Try <p style="text-align:right;">16th January, 2007</p>

By the way, align is a deprecated attribute [webmasterworld.com].

Mr Bo Jangles

10+ Year Member



 
Msg#: 3507865 posted 4:46 am on Nov 18, 2007 (gmt 0)

Hi Tedster, and thank you.

That doesn't appear to work for me.

(and in any case, if I just deleted the <p></p> it doesn't change things either)

kwasher

10+ Year Member



 
Msg#: 3507865 posted 5:34 am on Nov 18, 2007 (gmt 0)

<td WIDTH=65% ALIGN="LEFT" NOWRAP><p>Pay:&nbsp; &nbsp;<b> Acme Gardening </b></p><td>

<tr VALIGN=MIDDLE>
<td WIDTH=65% ALIGN="LEFT"><p> the sum of: &nbsp; &nbsp; <b>Two hundred five dollars and twenty cents </b></p><td>

It does appear to be aligning right (put a bgcolor into that td to see). Looks like some of the table tags are not closed.

tedster

WebmasterWorld Senior Member tedster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3507865 posted 5:43 am on Nov 18, 2007 (gmt 0)

If you temporarily place a border=1 attribute in the top table tag, you will see that your code has somehow created 4 columns, rather than the three you intended. So it is not an align issue.

Mr Bo Jangles

10+ Year Member



 
Msg#: 3507865 posted 5:45 am on Nov 18, 2007 (gmt 0)

Ah....
that was it! A number of the <td> tags not closed properly - thank you so much.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
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