IE 和 FF 中的网格线颜色

发布于 2024-08-03 22:38:56 字数 229 浏览 11 评论 0原文

我在 gridview 上将网格线设置为 true,我希望线条为灰色。 默认情况下,由于我的样式表,IE 中的线条显示为灰色;但在 Firefox 中,标题列之间有一条黑线分隔。

我尝试添加

this.GridView1.Attributes.Add("bordercolor", "#ddd"); 

这修复了 FireFox 问题,但在 IE 中它显示黑线。

I have gridlines set to true on a gridview, i want the lines to be grey.
By default, the lines in IE appear grey, due to my stylesheets; but in Firefox, there is a dark line separating the header columns.

I have tried adding

this.GridView1.Attributes.Add("bordercolor", "#ddd"); 

This fixes the FireFox issue, but in IE it shows the dark lines.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

泪眸﹌ 2024-08-10 22:38:57

我知道这是一个老话题,但也需要解决方案,而 @rism 的解决方案不适用,所以我想出了最简单的方案。

在CSS中

td
{
 border:1px solid #ddd; 
}

I know it's an old topic but needed solution for this too and @rism's solution did not apply , so i came up with simplest of all.

in css

td
{
 border:1px solid #ddd; 
}
贩梦商人 2024-08-10 22:38:57

您以编程方式执行此操作是否有原因?

如果打开 html 文件(.ascx、.aspx),您应该能够在网格上使用 style="border:1pxsolid #ddd;" 设置内联样式或者最好使用网格的 CssClass 属性并将其指向外部定义的样式 CssClass="myGridStyle" 其中 myGridStyle 定义为

.myGridStyle {
   border:1px solid #ddd;
}

Is there a reason why you are doing this programmatically?

If you open the html file (.ascx, .aspx) you should be able to set an inline style on the grid with style="border:1px solid #ddd;" or preferably use the CssClass property of the grid and point it at an externally defined style CssClass="myGridStyle" where myGridStyle is defined as

.myGridStyle {
   border:1px solid #ddd;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文