table align = center || right, difference in <br />

14,344

Normally, an HTML table will have a break before and after it. The align attribute allows other HTML elements to wrap around the table.

So your breaks are actually to the left of the table when you use right align.

The align attribute is now deprecated so should not be used.

Put your table styling, including all that style hardcoded for td and th, into your css file.

Share:
14,344
John
Author by

John

Updated on June 04, 2022

Comments

  • John
    John almost 2 years

    In asp.net I have created a table:

    <table border="1" align="right" class="detailstable StartOnNewPage">
             <tr>                 
                    <td style="text-align:left; width:100px;">Miscellaneous</td> 
                    <th style="text-align:right; width:100px" class="FadeOutOnEdit"><%: this.FormatMoney(MiscellaneousItemsTotal) %></th>                 
             </tr>
             <tr>                  
                    <th style="text-align:right; width:100px;"><%: this.DisplayMiscellaneousPercentage%></th>    
                    <td style="text-align:right; width:100px;"><%: this.MiscellaneousToDisplayWithTwoDecimalPlaces%></td> 
             </tr>
             <tr>   
                    <th style="text-align:left; width:100px;">TOTAL</th> 
                    <th style="text-align:right; width:100px;"><%: this.FormatMoney(TotalOfAll)%></th>                 
            </tr>
            </table>
    
            <br />
            <br />
            <br />
    

    If the align of the table is set to 'right' it doesnt pick up the 3 <br />, but if I set the table to align="center" it does...any ideas as to why this is?