Table.HorizontalAlign Vlastnost

Definice

Získá nebo nastaví vodorovné zarovnání Table ovládacího prvku na stránce.

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

Hodnota vlastnosti

Jedna z hodnot výčtu HorizontalAlign . Výchozí hodnota je NotSet.

Atributy

Příklady

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

Poznámky

HorizontalAlign Pomocí vlastnosti určete vodorovné zarovnání Table ovládacího prvku v rámci stránky. Následující tabulka uvádí různé styly vodorovného zarovnání.

Hodnota HorizontalAlign Description
NotSet Vodorovné zarovnání Table ovládacího prvku nebylo nastaveno.
Left Ovládací Table prvek je na stránce zasunut doleva.
Center Ovládací Table prvek je uprostřed stránky.
Right Ovládací Table prvek má na stránce zarovnání doprava.
Justify Ovládací Table prvek je zarovnán k levému i pravému okraji stránky.

Platí pro

Viz také