TableRow.TableSection Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
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 Propriedade
Um valor de TableRowSection. A predefinição é TableBody.
Exceções
O TableRowSection não é válido.
Exemplos
O exemplo de código seguinte demonstra como usar a TableSection propriedade para definir linhas de cabeçalho e rodapé num Table controlo.
<%@ 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>
Observações
Use a TableSection propriedade para obter ou definir onde o TableRow objeto está colocado num Table controlo. Para as localizações disponíveis nas tabelas, veja TableRowSection. A tabela seguinte lista os valores possíveis.
| Secção de linhas de tabela | Exibido como |
|---|---|
| TableHeader | A linha de cabeçalho. |
| TableBody | O corpo da mesa. |
| TableFooter | A fila do fundo. |
Ao usar a sintaxe declarativa, as secções devem estar na ordem do cabeçalho, corpo e depois rodapé.
A TableRowSection enumeração permite-lhe construir sites Web acessíveis usando o Table controlo, adicionando os <thead>, <tbody>, e <tfoot> elementos ao HTML que é renderizado para o cliente. Se todas as linhas de uma tabela estiverem no <tbody> elemento, a informação da secção não é renderizada. Pelo menos uma linha deve estar num elemento não-corpo.
O valor desta propriedade é armazenado no estado de visualização.