TableRow.TableSection Propiedad

Definición

Obtiene o establece la ubicación de un objeto TableRow en un control 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

Valor de propiedad

TableRowSection

Valor TableRowSection. De manera predeterminada, es TableBody.

Excepciones

Ejemplos

En el ejemplo de código siguiente se muestra cómo usar la TableSection propiedad para definir filas de encabezado y pie de página en un Table control .

<%@ 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>

Comentarios

Utilice la TableSection propiedad para obtener o establecer dónde se coloca el TableRow objeto en un Table control . Para conocer las ubicaciones de tabla disponibles, consulte TableRowSection. En la tabla siguiente se enumeran los valores posibles.

Sección fila de tabla Se muestra como
TableHeader Fila de encabezado.
TableBody Cuerpo de la tabla.
TableFooter Fila de pie de página.

Al usar la sintaxis declarativa, las secciones deben estar en el orden de encabezado, cuerpo y pie de página.

La TableRowSection enumeración permite crear sitios web accesibles mediante el Table control agregando los <thead>elementos , <tbody>y <tfoot> al HTML que se representa en el cliente. Si todas las filas de una tabla están en el <tbody> elemento , la información de sección no se representa. Al menos una fila debe estar en un elemento que no sea body.

El valor de esta propiedad se almacena en estado de vista.

Se aplica a

Consulte también