Click here to Skip to main content
15,886,810 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
XML
Hi - I'm trying to apply some spacing between the columns on a gridview, here's what I have so far with gridview setup and css

<asp:GridView id="gdvEnvironmentApps" runat="server" OnRowCommand="gdvEnvironmentApps_RowCommand"
                  CssClass="gridview" GridLines="Horizontal"
                  CellPadding="4" EmptyDataText="No Records Found"
                  AutoGenerateColumns="False" >
                  <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Left"  />
                  <HeaderStyle CssClass="gridviewHeader"/>
                  <AlternatingRowStyle BackColor="White" ForeColor="#333333"   />
                  <EmptyDataRowStyle CssClass="Label_Small_Bold" ForeColor="#C00000" HorizontalAlign="Center"  />

CSS

.gridview
{
    width:98%;
    border:solid 1px #bbbbbb;
    /* align-content:space-around;
    font-family: Arial;
    font-size: smaller;
    padding: 0em 1.2em; */
    padding-right: 10em;
    font: 8pt "tahoma";
}
.gridviewHeader
{
    background: #c8dce1 url(../images/tablehead_bg_v2.gif) 0 0 repeat-x;
    border:solid 1px;
    width:98%;
    font-weight: bold;
    height:30px;
    padding-right: 10em;
}
What else should I be checking that is overriding the CSS
Posted

 
Share this answer
 
Comments
Gihan Liyanage 5-Sep-14 5:51am    
Good One
Use padding

CSS
.gridview
{
    padding-left: 10px;
    padding-right: 10px;
}
 
Share this answer
 
Comments
pmcm 5-Sep-14 5:20am    
i tried this but still the data in the cols is not spaced

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