Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

<table style="text-align: center" width="500" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td align="center">
                                    <asp:Label ID="Label1" runat="server" SkinID="TableHeading" Text="Report"
                                        Width="100%"></asp:Label></td>
                            </tr>
                            <tr>
                                <td align="center">
                                    <asp:Label ID="Label2" runat="server" Text="Access No"></asp:Label>
                                    <asp:TextBox ID="txtaccno" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                        </table>

 

this code is working fine in internet explorer but in mozilla it alings left

Posted

I suggest you do some reading on CSS and especially the different implimentations between browsers.  If you're doing web work, you'd do well to have some resources on this subject, because it's going to affect you over and over again.

 
Share this answer
 

table style="text-align:center" doesnt make the table center aligned.
You need to wrap a container div around your table and make that center aligned.

Use like this :

<div style="width:100%; text-align:center">
         <table style="text-align: center" width="500" border="0" 
                             cellpadding="0" cellspacing="0">
                <tr>
                   <td align="center">
                    <asp:Label ID="Label1" runat="server" SkinID="TableHeading" 
                            Text="Report"  Width="100%"></asp:Label></td>
                 </tr>
                 <tr>
                     <td align="center">
                    <asp:Label ID="Label2" runat="server" Text="Access No">
                    </asp:Label>
                    <asp:TextBox ID="txtaccno" runat="server"></asp:TextBox>
                     </td>
                 </tr>
         </table> 
</div>

I hope this would work.

 
Share this answer
 
it's only css issue, you should reconsider your css scripts espesially that firefox and ie have some different css rendering issue
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900