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

HtmlTableRow のインスタンスで表される行の高さ (ピクセル単位)。既定値は String.Empty で、このプロパティが設定されていないことを示します。


Height プロパティを使用して、HtmlTable コントロール内の行の高さを制御する方法を次のコード例に示します。
<%@ Page Language="VB" AutoEventWireup="True" %> <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> <head> <title>HtmlTableRow Example</title> </head> <body> <form runat="server"> <h3>HtmlTableRow Example</h3> <table id="Table1" border="1" bordercolor="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>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>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>
<%@ Page Language="C#" AutoEventWireup="True" %> <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> <head> <title>HtmlTableRow Example</title> </head> <body> <form runat="server"> <h3>HtmlTableRow Example</h3> <table id="Table1" border="1" bordercolor="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>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>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="JScript" AutoEventWireup="True" %> <script runat="server"> function Button_Click(sender, e : EventArgs) { // Iterate through the rows of the table. for (var i : int=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> <head> <title>HtmlTableRow Example</title> </head> <body> <form runat="server"> <h3>HtmlTableRow Example</h3> <table id="Table1" border="1" bordercolor="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>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>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>

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に収録されているすべての辞書からHtmlTableRow.Height プロパティを検索する場合は、下記のリンクをクリックしてください。

- HtmlTableRow.Height プロパティのページへのリンク