Table.HorizontalAlign Własność
Definicja
Ważny
Niektóre informacje dotyczą produktów przedpremierowych, które mogą zostać znacznie zmodyfikowane przed premierą. Microsoft nie udziela żadnych gwarancji, ani wyraźnych, ani domniemanych, dotyczących informacji podanych tutaj.
Pobiera lub ustawia wyrównanie w poziomie kontrolki Table na stronie.
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
Wartość nieruchomości
HorizontalAlign Jedna z wartości wyliczenia. Wartość domyślna to NotSet.
- Atrybuty
Przykłady
<%@ 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>
Uwagi
HorizontalAlign Użyj właściwości , aby określić wyrównanie w poziomie kontrolki Table na stronie. W poniższej tabeli wymieniono różne style wyrównania poziomego.
| Wartość HorizontalAlign | Opis |
|---|---|
NotSet |
Wyrównanie w poziomie kontrolki Table nie zostało ustawione. |
Left |
Kontrolka Table jest pozostawiona uzasadniona na stronie. |
Center |
Kontrolka Table jest wyśrodkowana na stronie. |
Right |
Kontrolka jest uzasadniona Table na stronie. |
Justify |
Kontrolka Table jest wyrównana zarówno do lewego, jak i prawego marginesu strony. |