css - How can i place Gridview center of div or panel.? -
hello! can tell me how can place gridview
in center in div
or panel? have applied following css not working:
<asp:panel id="pnlgrid" cssclass="panel" runat="server"> <div style="text-align:center"> <asp:gridview id="grdreqapproval" runat="server" autogeneratecolumns="false" cssclass="simplegrid"> <columns> <asp:boundfield datafield="approved by" headertext="approved by" /> <asp:boundfield datafield="user name" headertext="user name" /> <asp:boundfield datafield="approval time" headertext="approvel time" /> </columns> </asp:gridview> </div> </asp:panel> .panel { width: 330px; padding: 10px; min-height: 20px; border: 1px solid #dcdcdc; margin-left:auto; margin-right:auto; }
horizontalalign
property of gridview can solve problem
<asp:panel id="pid" runat="server"> <div> <asp:gridview id="gvid" runat="server" autogeneratecolumns="false" horizontalalign="center"> <columns> ... ... </columns> </asp:gridview> </div>
Comments
Post a Comment