HtmlTableRow.BorderColor Propriedade
Definição
Obtém ou define a cor da borda da linha representada por uma instância da classe HtmlTableRow.Gets or sets the border color of the row represented by an instance of the HtmlTableRow class.
public:
property System::String ^ BorderColor { System::String ^ get(); void set(System::String ^ value); };
public string BorderColor { get; set; }
member this.BorderColor : string with get, set
Public Property BorderColor As String
Valor da propriedade
A cor da borda da linha representada por uma instância do HtmlTableRow .The border color of the row represented by an instance of HtmlTableRow.
Exemplos
O exemplo de código a seguir demonstra como usar a BorderColor propriedade para controlar a cor da borda de uma linha no HtmlTable controle.The following code example demonstrates how to use the BorderColor property to control the border color of a row in the HtmlTable control.
<%@ Page Language="C#" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
void Button_Click(Object sender, EventArgs e)
{
// Iterate through the rows of the table.
for (int i = 0; i <= Table1.Rows.Count - 1; i++)
{
// Update the properties of each row.
Table1.Rows[i].BgColor = BgColorSelect.Value;
Table1.Rows[i].BorderColor = BorderColorSelect.Value;
Table1.Rows[i].Height = HeightSelect.Value;
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>HtmlTableRow Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>HtmlTableRow Example</h3>
<table id="Table1"
style="border-width:1; border-color:Black"
runat="server">
<tr>
<td>
Cell 1.
</td>
<td>
Cell 2.
</td>
</tr>
<tr>
<td>
Cell 3.
</td>
<td>
Cell 4.
</td>
</tr>
</table>
<hr />
Select the display settings for the rows in the table: <br /><br />
BgColor:
<select id="BgColorSelect"
runat="server">
<option value="Red">Red</option>
<option value="Blue">Blue</option>
<option value="Green">Green</option>
<option value="Black">Black</option>
<option value="White" selected="selected">White</option>
</select>
BorderColor:
<select id="BorderColorSelect"
runat="server">
<option value="Red">Red</option>
<option value="Blue">Blue</option>
<option value="Green">Green</option>
<option value="Black" selected="selected">Black</option>
<option value="White">White</option>
</select>
<br /><br />
Height:
<select id="HeightSelect"
runat="server">
<option value="0">0</option>
<option value="100">100</option>
<option value="150">150</option>
<option value="200">200</option>
<option value="250">250</option>
</select>
<br /><br />
<input type="button"
value="Generate Table"
onserverclick="Button_Click"
runat="server"/>
</form>
</body>
</html>
<%@ Page Language="VB" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Sub Button_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim i As Integer
' Iterate through the rows of the table.
For i = 0 To Table1.Rows.Count - 1
' Update the properties of each row.
Table1.Rows(i).BgColor = BgColorSelect.Value
Table1.Rows(i).BorderColor = BorderColorSelect.Value
Table1.Rows(i).Height = HeightSelect.Value
Next i
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>HtmlTableRow Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>HtmlTableRow Example</h3>
<table id="Table1"
style="border-width:1; border-color:Black"
runat="server">
<tr>
<td>
Cell 1.
</td>
<td>
Cell 2.
</td>
</tr>
<tr>
<td>
Cell 3.
</td>
<td>
Cell 4.
</td>
</tr>
</table>
<hr />
Select the display settings for the rows in the table: <br /><br />
BgColor:
<select id="BgColorSelect"
runat="server">
<option value="Red">Red</option>
<option value="Blue">Blue</option>
<option value="Green">Green</option>
<option value="Black">Black</option>
<option value="White" selected="selected">White</option>
</select>
BorderColor:
<select id="BorderColorSelect"
runat="server">
<option value="Red">Red</option>
<option value="Blue">Blue</option>
<option value="Green">Green</option>
<option value="Black" selected="selected">Black</option>
<option value="White">White</option>
</select>
<br /><br />
Height:
<select id="HeightSelect"
runat="server">
<option value="0">0</option>
<option value="100">100</option>
<option value="150">150</option>
<option value="200">200</option>
<option value="250">250</option>
</select>
<br /><br />
<input id="Button1" type="button"
value="Generate Table"
onserverclick="Button_Click"
runat="server"/>
</form>
</body>
</html>
Comentários
Use a BorderColor propriedade para especificar a cor da borda da linha representada por uma instância da HtmlTableRow classe.Use the BorderColor property to specify the border color of the row represented by an instance of the HtmlTableRow class. Você pode especificar uma cor por nome ou usando um valor hexadecimal, precedido pelo caractere de sustenido (#), no formato #RRGGBB.You can specify a color either by name or by using a hexadecimal value, preceded by the pound character (#), in the form #RRGGBB. RR, GG e BB representam valores hexadecimais de 0 a 255 que indicam os componentes vermelho, verde e azul de uma cor, respectivamente.RR, GG, and BB represent hexadecimal values from 0 to 255 that indicate the red, green, and blue components of a color, respectively. Por exemplo, o valor #0000FF representa a cor azul.For example, the value #0000FF represents the color blue. Ele especifica o valor mínimo (00) para os componentes vermelho e verde, ao mesmo tempo que especifica o valor máximo (FF) para o componente azul.It specifies the minimum value (00) for the red and green components, while specifying the maximum value (FF) for the blue component.
A tabela a seguir mostra os dezesseis nomes de cores HTML predefinidos e valores hexadecimais correspondentes que podem ser usados para a BorderColor propriedade.The following table shows the sixteen predefined HTML color names and corresponding hexadecimal values that can be used for the BorderColor property. Para obter mais informações sobre cores HTML, consulte o site da World Wide Web Consortium (W3C).For more information on HTML colors, see the World Wide Web Consortium (W3C) Web site.
| Nome da corColor name | Valor hexadecimalHexadecimal value |
|---|---|
| AquaAqua | #00FFFF#00FFFF |
| PretoBlack | #000000#000000 |
| AzulBlue | #0000FF#0000FF |
| FuchsiaFuchsia | #FF00FF#FF00FF |
| CinzaGray | #808080#808080 |
| VerdeGreen | #008000#008000 |
| CascaLime | #00FF00#00FF00 |
| CastanhoMaroon | #800000#800000 |
| Azul-marinhoNavy | #000080#000080 |
| OlivaOlive | #808000#808000 |
| RoxoPurple | #800080#800080 |
| VermelhoRed | #FF0000#FF0000 |
| PrataSilver | #C0C0C0#C0C0C0 |
| Azul-petróleoTeal | #008080#008080 |
| BrancaWhite | #FFFFFF#FFFFFF |
| AmareloYellow | #FFFF00#FFFF00 |
As cores disponíveis para uso com a BorderColor propriedade podem ser determinadas a partir da KnownColor enumeração.The available colors for use with the BorderColor property can be determined from the KnownColor enumeration.
Os nomes de cor não diferenciam maiúsculas de minúsculas.Color names are case-insensitive.