gpt4 book ai didi

css - asp.net mvc3 webgrid 标题样式,css

转载 作者:行者123 更新时间:2023-11-28 13:38:22 25 4
gpt4 key购买 nike

我在元素的局部 View 中使用了 webgrid。我用表格样式很好地实现了它:

.webgridtablestyle
{
width: 100%;
height: auto;

}

它显示正常。现在我想为 webgrid 中的不同标题定义不同的宽度。所以我将其应用为:

grid.Column("EquipmentManfacturer", header: "Warranty Provider", style:"width:30%")

但是宽度没有应用。我尝试通过提供 table-layout: fixed in table style also.The table layout style had applied 但宽度样式没有应用于标题。任何人都可以帮助我如何为 webgrid 中的不同标题应用不同的宽度。我只需要使用表格宽度的百分比,因为放置 webgrid 的仪表板可以调整大小。

最佳答案

据我了解,style 属性实际上是列获得的类。

因此,创建一个具有所需宽度的类,并在style 属性中使用该类。

.column1
{
width: 30%;
}

然后

grid.Column("EquipmentManfacturer", header: "Warranty Provider", style:"column1")

编辑:需要设置整个网格的宽度属性,在网格上设置一个带有 tableStyle 的类,并让该类定义一个宽度属性

关于css - asp.net mvc3 webgrid 标题样式,css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8786587/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com