HtmlTableRow クラスとは? わかりやすく解説

HtmlTableRow クラス

HtmlTable コントロール<tr> HTML 要素表します

名前空間: System.Web.UI.HtmlControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Class HtmlTableRow
    Inherits HtmlContainerControl
public class HtmlTableRow : HtmlContainerControl
public ref class HtmlTableRow : public
 HtmlContainerControl
public class HtmlTableRow extends HtmlContainerControl
public class HtmlTableRow extends
 HtmlContainerControl
解説解説

<tr> 要素テーブルの行を表しますHtmlTableRow クラス使用してHtmlTable コントロール<tr> HTML 要素プログラム制御します

HtmlTableRow クラス使用すると、行内セル背景色境界線の色、および高さを指定してテーブル内の行の外観カスタマイズできます。これらの属性BgColor、BorderColor、Height の各プロパティ使用して設定されます。

Align プロパティVAlign プロパティ使用すると、行全体セル内容配置制御できますAlign プロパティセル内容水平方向配置制御しVAlign プロパティは垂直方向の配置制御します

このクラスCells コレクション使用することにより、テーブル行内の各セルプログラムアクセスできます。このコレクション使用すると、内容同様にセルプロパティ制御できます

HtmlTableRowインスタンス初期プロパティ値の一覧については、HtmlTableRow コンストラクタトピック参照してください

使用例使用例

HtmlTableRow インスタンス使用してHtmlTable コントロール内の行を表す方法次のコード例示しますHtmlTableRowテーブルRows コレクションから取得してその内容変更します

<%@ Page Language="VB" AutoEventWireup="True"
 %>

<script runat="server">

  Sub Button_Click(ByVal sender As
 Object, ByVal e As EventArgs)
      
    Dim i As Integer
    Dim j As Integer

    ' Iterate through the rows of the table.
    For i = 0 To Table1.Rows.Count - 1

      ' Iterate through the cells of a row.       
      For j = 0 To Table1.Rows(i).Cells.Count
 - 1
            
        ' Change the inner HTML of the cell.
        Table1.Rows(i).Cells(j).InnerHtml = "Row "
 & i.ToString() & _
                                            ", Column "
 & j.ToString()
      Next j

    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>

      <br><br>
  
      <input type="button" 
             value="Change Table Contents"
             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++)
    {

      // Iterate through the cells of a row.
      for (int j = 0; j <= Table1.Rows[i].Cells.Count
 - 1; j++)
      {
        // Change the inner HTML of the cell.
        Table1.Rows[i].Cells[j].InnerHtml = "Row " + i.ToString() +
                                            ", Column " + j.ToString();
      }

    }

  }

</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>

      <br><br>
  
      <input type="button" 
             value="Change Table Contents"
             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++)
    {

      // Iterate through the cells of a row.
      for (var j : int =0;
 j<=Table1.Rows[i].Cells.Count - 1; j++)
      {
        // Change the inner HTML of the cell.
        Table1.Rows[i].Cells[j].InnerHtml = "Row " + i.ToString() + 
                                                   ", Column " + j.ToString();
 
      }

    }

  }

</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>

      <br><br>
  
      <input type="button" 
             value="Change Table Contents"
             onserverclick="Button_Click" 
             runat="server"/>

   </form>

</body>
</html>
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
   System.Web.UI.Control
     System.Web.UI.HtmlControls.HtmlControl
       System.Web.UI.HtmlControls.HtmlContainerControl
        System.Web.UI.HtmlControls.HtmlTableRow
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からHtmlTableRow クラスを検索した結果を表示しています。
Weblioに収録されているすべての辞書からHtmlTableRow クラスを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からHtmlTableRow クラス を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「HtmlTableRow クラス」の関連用語

HtmlTableRow クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



HtmlTableRow クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS