Consider this HTML table which I am displaying in a web page
In the above table, all the amounts are right-aligned in each <td>. As you can see, the amounts under the 'Bal.' column are all 0.00. As a result, the width of this column becomes smaller than the rest of the three columns. To ensure that the width of all the 4 columns are more or less the same, what I did for the amounts under the Bal. column is introduced width=60 i.e.
<td align=right width=60>
so that even if all the amounts under the Bal. column are zero, its width will look more or less the same as the width of the other 3 columns. Note that I have put width=60 for the amounts in the Bal. column only - not in the other 3 columns. But now what happens is since I have introduced width=60, the amounts in the Bal. column are not pushed towards the extreme right side of the <td>. These amounts get shifted slightly towards the left hand side. If I remove width=60 then this problem doesn't come up. How do I ensure that the amounts are displayed towards the extreme right hand side of the <td> inspite of specifying the width of the <td>?
Thanks,
Arpan
Code:
---------------------------------------------------------
Name Total Amount Amount Paid Bal.
---------------------------------------------------------
Charles 50000.00 50000.00 0.00
Mary 75000.00 75000.00 0.00
Ben 4000.00 2500.00 0.00
Diana 15000.00 4000.00 0.00
Mike 25000.00 25000.00 0.00
---------------------------------------------------------
<td align=right width=60>
so that even if all the amounts under the Bal. column are zero, its width will look more or less the same as the width of the other 3 columns. Note that I have put width=60 for the amounts in the Bal. column only - not in the other 3 columns. But now what happens is since I have introduced width=60, the amounts in the Bal. column are not pushed towards the extreme right side of the <td>. These amounts get shifted slightly towards the left hand side. If I remove width=60 then this problem doesn't come up. How do I ensure that the amounts are displayed towards the extreme right hand side of the <td> inspite of specifying the width of the <td>?
Thanks,
Arpan