如何更改列中网格视图间距的布局 [英] how to change the layout of grid view spacing in a column

查看:184
本文介绍了如何更改列中网格视图间距的布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有第一个最顶部的单元格,背面颜色为红色,另外一个单元格的颜色为黑色........现在我想要的是我应该在两个单元格之间有一些空间我应用了单元格填充和单元格间距但没有变化



告诉我这方面





问候

i have first top most cell with back color red and its adjacent one more cell with black color........now what i want is that i should have some space between both cells i applied cell padding and cell spacing but no change

tell me in this regard


regards

推荐答案

您是否指定了gridview的宽度?

如果是,则确保宽度适应填充/单元格间距还有。



将CSS样式应用到Gridview中这样

修改以下内容以适合您的gridview

Have you specified the gridview''s width?
If Yes, then make sure that the width accommodates the padding/cell spacing as well.

Apply CSS styling to the Gridview like this
modify the below to fit your gridview
<asp:GridView ID="GridView1" runat="server" CssClass="mGrid1">





然后将以下内容添加到您的CSS表格中



修改以下是满足您视觉需求的设置。



then add the below into your CSS sheet

modify the below to the setting that would suite you visual need.

.mGrid1
{
    width: 100%;
    font-family: tahoma;
}

.mGrid1 td   /* this applies to the Gridviews Data fileds */
{
    padding: 1px;
    text-align:center;
    width: 3%;
    border: solid 1px black;
    border-collapse: collapse;
}
.mGrid1 th   /* this applies to the Gridviews Headers */
{
     padding: 0px 0px;
     border-width: 1px;
}





希望这有帮助



Hope this helps


这篇关于如何更改列中网格视图间距的布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆