Gridview样式格式 [英] Gridview styling formatting
本文介绍了Gridview样式格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
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
推荐答案
试试这个
GridView - 使用CSS向细胞添加填充 [< a href =http://stackoverflow.com/questions/2768891/gridview-add-padding-to-cells-with-csstarget =_ blanktitle =New Window> ^ ]
使用填充
Use padding
.gridview
{
padding-left: 10px;
padding-right: 10px;
}
这篇关于Gridview样式格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文