Click here to Skip to main content
15,912,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I have used center tag in my page , in center there is table and gridview.
In IE, there are in Center. But in Mozilla and crome they are at left side.

Help me out.
Posted
Comments
AshishChaudha 13-Aug-12 2:49am    
could you please show us your aspx code.
StianSandberg 13-Aug-12 2:57am    
You should not use the center tag. Use css. (text-align:center)

You can use div tag instead of center. And set the
align property of div to center.
HTML
<div class="ParentDiv" align="center" style="margin:0;">
  <div class="ChildDiv" style="width:800px;">
    <div class="Content">
     <!--your girdview-->

    </div>
  </div>
</div>


I hope it will help you.
Best of luck.
 
Share this answer
 
v2
Comments
Sant Osha 13-Aug-12 2:40am    
dear frnd,

i used that earlier but hasn't worked out.....
Raje_ 13-Aug-12 2:49am    
Why don't you try this code once again? Just put your GridView Control inside Content div. It's working fine.
Sant Osha 13-Aug-12 6:55am    
thnx buddyy.. it worked out...
<div style="width:80%;margin:0px auto;">
//put you code here this will be centered and work in all browsers
</div>
you can set width of the div as your requirement
 
Share this answer
 
v3

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