I want to center-align a GridView control in a <div>. But the GV seems to stay on top-left position of the div even after applying the methods below:
text-align : center and vertical-align : middle yields no results.
Neither does position : relative or margin : auto.
<div align="center"> works for horizontal alignment, but can’t find any form of valign for a <div>.
Layout so far:
<div id="content1" class="contentSingleCenter" >
<asp:GridView ID="grdGrid" runat="server"></asp:GridView>
</div>
CSS:
div.contentSingleCenter
{
width : 80%;
height : 200px;
position: relative;
margin: auto;
}
My main requirement is that I can’t use a table to do this.
Any ideas? TIA.
Actually, I’ve found a fix…
<align="center">and a bit of padding seems to work : )