HtmlTable.BorderColor プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As HtmlTable Dim value As String value = instance.BorderColor instance.BorderColor = value
/** @property */ public String get_BorderColor () /** @property */ public void set_BorderColor (String value)
HtmlTable コントロールの境界線の色。既定値は String.Empty で、このプロパティが設定されていないことを示します。

BorderColor プロパティを使用して、HtmlTable コントロールの境界線の色を指定します。色は、名前で指定するか、16 進値の前にシャープ記号 (#) を付けて #RRGGBB の形式で指定できます。RR、GG、および BB はそれぞれ、色の赤、緑、および青の各要素を示す 0 ~ 255 の範囲の 16 進値を表します。たとえば、#0000FF という値は青を表します。これは、赤と緑の要素に最小値 (00) を指定し、青の要素に最大値 (FF) を指定します。
16 種類の定義済みの HTML カラーの名前と、BorderColor プロパティに使用できる対応する 16 進値を次の表に示します。HTML カラーの詳細については、W3C (World Wide Web Consortium) Web サイトを参照してください。
カラー名 | 16 進値 |
---|---|
#00FFFF | |
黒 | #000000 |
青 | #0000FF |
#FF00FF | |
#808080 | |
緑 | #008000 |
#00FF00 | |
#800000 | |
濃い青 | #000080 |
#808000 | |
紫 | #800080 |
赤 | #FF0000 |
#C0C0C0 | |
#008080 | |
白 | #FFFFFF |
黄 | #FFFF00 |

BorderColor プロパティを使用して、HtmlTable コントロールの境界線の色をプログラムで制御する方法を次のコード例に示します。
<%@ Page Language="VB" AutoEventWireup="True" %> <script runat="server"> Sub Button_Click(ByVal sender As Object, ByVal e As EventArgs) ' Set the properties of the HtmlTable with the ' user selections. Table1.BgColor = BgColorSelect.Value Table1.Border = CInt(BorderSelect.Value) Table1.BorderColor = BorderColorSelect.Value Table1.Height = HeightSelect.Value Table1.Width = WidthSelect.Value End Sub </script> <html> <head> <title>HtmlTable Example</title> </head> <body> <form runat="server"> <h3>HtmlTable Example</h3> <table id="Table1" Border="1" BorderColor="black" runat="server"> <tr> <th> Column 1 </th> <th> Column 2 </th> <th> Column 3 </th> </tr> <tr> <td> Cell 1 </td> <td> Cell 2 </td> <td> Cell 3 </td> </tr> <tr> <td> Cell 4 </td> <td> Cell 5 </td> <td> Cell 6 </td> </tr> </table> <hr> Select the display settings: <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>White</option> </select> Border: <select id="BorderSelect" runat="server"> <option Value="0">0</option> <option Value="1" Selected>1</option> <option Value="2">2</option> <option Value="3">3</option> <option Value="4">4</option> <option Value="5">5</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>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> Width: <select id="WidthSelect" runat="server"> <option Value="0">0</option> <option Value="200">200</option> <option Value="250">250</option> <option Value="300">300</option> <option Value="350">350</option> </select> <br><br> <input type="button" value="Generate Table" OnServerClick ="Button_Click" runat="server"/> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <script runat="server"> void Button_Click(Object sender, EventArgs e) { // Set the properties of the HtmlTable with the // user selections. Table1.BgColor = BgColorSelect.Value; Table1.Border = Convert.ToInt32(BorderSelect.Value); Table1.BorderColor = BorderColorSelect.Value; Table1.Height = HeightSelect.Value; Table1.Width = WidthSelect.Value; } </script> <html> <head> <title>HtmlTable Example</title> </head> <body> <form runat="server"> <h3>HtmlTable Example</h3> <table id="Table1" Border="1" BorderColor="black" runat="server"> <tr> <th> Column 1 </th> <th> Column 2 </th> <th> Column 3 </th> </tr> <tr> <td> Cell 1 </td> <td> Cell 2 </td> <td> Cell 3 </td> </tr> <tr> <td> Cell 4 </td> <td> Cell 5 </td> <td> Cell 6 </td> </tr> </table> <hr> Select the display settings: <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>White</option> </select> Border: <select id="BorderSelect" runat="server"> <option Value="0">0</option> <option Value="1" Selected>1</option> <option Value="2">2</option> <option Value="3">3</option> <option Value="4">4</option> <option Value="5">5</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>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> Width: <select id="WidthSelect" runat="server"> <option Value="0">0</option> <option Value="200">200</option> <option Value="250">250</option> <option Value="300">300</option> <option Value="350">350</option> </select> <br><br> <input type="button" value="Generate Table" OnServerClick ="Button_Click" runat="server"/> </form> </body> </html>
<%@ Page Language="JScript" AutoEventWireup="True" %> <script runat="server"> function Button_Click(sender : Object, e : EventArgs) { // Set the properties of the HtmlTable with the // user selections. Table1.BgColor = BgColorSelect.Value; Table1.Border = Convert.ToInt32(BorderSelect.Value); Table1.BorderColor = BorderColorSelect.Value; Table1.Height = HeightSelect.Value; Table1.Width = WidthSelect.Value; } </script> <html> <head> <title>HtmlTable Example</title> </head> <body> <form runat="server"> <h3>HtmlTable Example</h3> <table id="Table1" Border="1" BorderColor="black" runat="server"> <tr> <th> Column 1 </th> <th> Column 2 </th> <th> Column 3 </th> </tr> <tr> <td> Cell 1 </td> <td> Cell 2 </td> <td> Cell 3 </td> </tr> <tr> <td> Cell 4 </td> <td> Cell 5 </td> <td> Cell 6 </td> </tr> </table> <hr> Select the display settings: <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>White</option> </select> Border: <select id="BorderSelect" runat="server"> <option Value="0">0</option> <option Value="1" Selected>1</option> <option Value="2">2</option> <option Value="3">3</option> <option Value="4">4</option> <option Value="5">5</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>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> Width: <select id="WidthSelect" runat="server"> <option Value="0">0</option> <option Value="200">200</option> <option Value="250">250</option> <option Value="300">300</option> <option Value="350">350</option> </select> <br><br> <input type="button" value="Generate Table" OnServerClick ="Button_Click" runat="server"/> </form> </body> </html>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からHtmlTable.BorderColor プロパティを検索する場合は、下記のリンクをクリックしてください。

- HtmlTable.BorderColor プロパティのページへのリンク