Table.HorizontalAlign Propiedad
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene o establece la alineación horizontal del control Table en la página.
public:
virtual property System::Web::UI::WebControls::HorizontalAlign HorizontalAlign { System::Web::UI::WebControls::HorizontalAlign get(); void set(System::Web::UI::WebControls::HorizontalAlign value); };
[System.ComponentModel.Bindable(true)]
public virtual System.Web.UI.WebControls.HorizontalAlign HorizontalAlign { get; set; }
public virtual System.Web.UI.WebControls.HorizontalAlign HorizontalAlign { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.HorizontalAlign : System.Web.UI.WebControls.HorizontalAlign with get, set
member this.HorizontalAlign : System.Web.UI.WebControls.HorizontalAlign with get, set
Public Overridable Property HorizontalAlign As HorizontalAlign
Valor de propiedad
Uno de los valores de enumeración de HorizontalAlign. El valor predeterminado es NotSet.
- Atributos
Ejemplos
<%@ 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="Head2" runat="server">
<title>Table - C# Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h3>Table - C# Example</h3>
<asp:Table id="Table1" runat="server"
GridLines="Both" BackImageUrl="image1.gif"
HorizontalAlign="Center" CellSpacing="3"
CellPadding="3">
<asp:TableRow>
<asp:TableCell>Row 0, Col 0</asp:TableCell>
<asp:TableCell>Row 0, Col 1</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>Row 1, Col 0</asp:TableCell>
<asp:TableCell>Row 1, Col 1</asp:TableCell>
</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="Head2" runat="server">
<title>Table - VB.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h3>Table - C# Example</h3>
<asp:Table id="Table1" runat="server"
GridLines="Both" BackImageUrl="image1.gif"
HorizontalAlign="Center" CellSpacing="3"
CellPadding="3">
<asp:TableRow>
<asp:TableCell>Row 0, Col 0</asp:TableCell>
<asp:TableCell>Row 0, Col 1</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>Row 1, Col 0</asp:TableCell>
<asp:TableCell>Row 1, Col 1</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</form>
</body>
</html>
Comentarios
Utilice la HorizontalAlign propiedad para especificar la alineación horizontal del Table control dentro de la página. En la tabla siguiente se enumeran los diferentes estilos de alineación horizontal.
| Valor HorizontalAlign | Descripción |
|---|---|
NotSet |
No se ha establecido la alineación horizontal del Table control. |
Left |
El Table control se deja justificado en la página. |
Center |
El Table control se centra en la página. |
Right |
El Table control está justificado correctamente en la página. |
Justify |
El Table control está alineado con los márgenes izquierdo y derecho de la página. |