TableRow.TableSection プロパティ

定義

TableRow コントロール内の Table オブジェクトの場所を取得または設定します。

public:
 virtual property System::Web::UI::WebControls::TableRowSection TableSection { System::Web::UI::WebControls::TableRowSection get(); void set(System::Web::UI::WebControls::TableRowSection value); };
public virtual System.Web.UI.WebControls.TableRowSection TableSection { get; set; }
member this.TableSection : System.Web.UI.WebControls.TableRowSection with get, set
Public Overridable Property TableSection As TableRowSection

プロパティ値

TableRowSection

TableRowSection 値。 既定値は、TableBody です。

例外

TableRowSection が有効ではありません。

次のコード例では、プロパティを使用して、コントロール内の TableSection ヘッダー行とフッター行を定義する方法を Table 示します。

<%@ page language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>TableRow, TableFooter Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

    <h1>TableRow, TableFooter Example</h1>
    <asp:table id="Table1" runat="server" CellPadding="3" CellSpacing="0">
        <asp:TableRow TableSection="TableHeader" BackColor="Pink">
            <asp:TableCell Text="Header" ColumnSpan="3" />
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell Text="(0,0)"></asp:TableCell>
            <asp:TableCell Text="(0,1)"></asp:TableCell>
            <asp:TableCell Text="(0,2)"></asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell Text="(1,0)"></asp:TableCell>
            <asp:TableCell Text="(1,1)"></asp:TableCell>
            <asp:TableCell Text="(1,2)"></asp:TableCell>
        </asp:TableRow>
        <asp:TableRow TableSection="TableFooter" BackColor="Pink">
            <asp:TableCell Text="Footer" ColumnSpan="3" />
        </asp:TableRow>
    </asp:table>

    </div>
    </form>
  </body>
</html>
<%@ page language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>TableRow, TableFooter Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

    <h1>TableRow, TableFooter Example</h1>
    <asp:table id="Table1" runat="server" CellPadding="3" CellSpacing="0">
        <asp:TableRow TableSection="TableHeader" BackColor="Pink">
            <asp:TableCell Text="Header" ColumnSpan="3" />
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell Text="(0,0)"></asp:TableCell>
            <asp:TableCell Text="(0,1)"></asp:TableCell>
            <asp:TableCell Text="(0,2)"></asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell Text="(1,0)"></asp:TableCell>
            <asp:TableCell Text="(1,1)"></asp:TableCell>
            <asp:TableCell Text="(1,2)"></asp:TableCell>
        </asp:TableRow>
        <asp:TableRow TableSection="TableFooter" BackColor="Pink">
            <asp:TableCell Text="Footer" ColumnSpan="3" />
        </asp:TableRow>
    </asp:table>

    </div>
    </form>
  </body>
</html>

注釈

このプロパティをTableSection使用して、オブジェクトがコントロール内のどこに配置されるかをTableRowTable取得または設定します。 使用可能なテーブルの場所については、次を参照してください TableRowSection。 次の表に、使用可能な値を示します。

テーブル行セクション 次のように表示されます
TableHeader ヘッダー行。
TableBody テーブルの本文。
TableFooter フッター行。

宣言構文を使用する場合、セクションはヘッダー、本文、フッターの順にする必要があります。

TableRowSection列挙体を使用すると、クライアントにレンダリングされる HTML に 、<tbody>および<tfoot>要素を追加<thead>することで、コントロールを使用してTableアクセス可能な Web サイトを構築できます。 テーブル内のすべての行が要素内にある <tbody> 場合、セクション情報はレンダリングされません。 本文以外の要素には、少なくとも 1 つの行が含まれる必要があります。

このプロパティの値は、ビューステートに格納されます。

適用対象

こちらもご覧ください