使用Gridview显示存储在数据库中的表,我想将边框颜色更改为#dbddff。它不会接受这个或 dbddff,我该怎么办?
<asp:GridView ID="GridView1" runat="server" AllowPaging="true" BorderColor="dbddff" AllowSoerting="true" Width="100px" AutoGenerateColumns="false" DataSourceID="GridDataSource">
谢谢
尝试将 BorderWidth 属性设置为 1px。
<asp:GridView ID="GridView1" runat="server" AllowPaging="true" BorderWidth="1px" BorderColor="dbddff" AllowSoerting="true" Width="100px" AutoGenerateColumns="false" DataSourceID="GridDataSource">
你的代码
问题是边框颜色中缺少#。这应该工作
您可以通过样式或样式表应用颜色吗?
#GridView1 {
border: solid 1px #dbddff;
}
您可以指定颜色或使用十六进制代码,在这种情况下,您需要在十六进制代码之前添加 #。边框的大小必须至少为 1 px 才能显示颜色。