日期:2014-05-20  浏览次数:20524 次

设置Table的网格线的颜色
我想设置web控件Table的网格线的颜色,要怎么设置

------解决方案--------------------
this.Table1.BorderColor = Color.Red;
------解决方案--------------------
<table id= "table1 " style= "border-color:你要的颜色 ">
------解决方案--------------------
呵呵this.Table1.BorderColor = Color.Red; 只能设置表格周围四条边框了
lz想要的里面每个单元格都有border吧?
使用样式了
#dataTAble { collapse: }
#dataTAble TD { BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid }

下面这个是例子
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN " >
<HTML>
<HEAD>
<title> csdn002 </title>
<meta name= "GENERATOR " Content= "Microsoft Visual Studio .NET 7.1 ">
<meta name= "CODE_LANGUAGE " Content= "C# ">
<meta name= "vs_defaultClientScript " content= "JavaScript ">
<meta name= "vs_targetSchema " content= "http://schemas.microsoft.com/intellisense/ie5 ">
<style type= "text/css ">
#dataTAble { collapse: }
#dataTAble TD { BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid }
TH { BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid }
</style>
</HEAD>
<body MS_POSITIONING= "GridLayout ">
<form id= "Form1 " method= "post " runat= "server ">
<asp:Table id= "dataTAble " style= "Z-INDEX: 101; LEFT: 176px; POSITION: absolute; TOP: 136px "
runat= "server " CellPadding= "0 " CellSpacing= "0 " Width= "496px " Height= "248px ">
<asp:TableRow>
<asp:TableCell Text= "111 "> </asp:TableCell>
<asp:TableCell Text= "222 "> </asp:TableCell>
<asp:TableCell Text= "333 "> </asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell Text= "666 "> </asp:TableCell>
<asp:TableCell Text= "555 "> </asp:TableCell>
<asp:TableCell Text= "444 "> </asp:TableCell>
</asp:TableRow>
</asp:Table>
</form>
</body>
</HTML>