Welcome to WebmasterWorld Guest from 54.146.221.231

Forum Moderators: incrediBILL

Message Too Old, No Replies

Simple Tables issue - but confounding to moi

.... why doesn't the text align right?

     
2:55 am on Nov 18, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:May 4, 2003
posts: 565
votes: 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>

__________________________

3:17 am on Nov 18, 2007 (gmt 0)

Senior Member

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

joined:May 26, 2000
posts:37301
votes: 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].

4:46 am on Nov 18, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:May 4, 2003
posts: 565
votes: 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)

5:34 am on Nov 18, 2007 (gmt 0)

Full Member

10+ Year Member

joined:Sept 24, 2003
posts:318
votes: 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.

5:43 am on Nov 18, 2007 (gmt 0)

Senior Member

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

joined:May 26, 2000
posts:37301
votes: 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.
5:45 am on Nov 18, 2007 (gmt 0)

Preferred Member

10+ Year Member

joined:May 4, 2003
posts: 565
votes: 0


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