Share via


HtmlTableRow.VAlign 속성

정의

HtmlTable 컨트롤의 행 셀에 있는 내용의 세로 맞춤을 가져오거나 설정합니다.

public:
 property System::String ^ VAlign { System::String ^ get(); void set(System::String ^ value); };
public string VAlign { get; set; }
member this.VAlign : string with get, set
Public Property VAlign As String

속성 값

HtmlTable 컨트롤의 행 셀에 있는 내용의 세로 맞춤입니다. 기본값은 Empty로, 이 속성이 설정되지 않았음을 나타냅니다.

예제

다음 코드 예제를 사용 하는 방법에 설명 합니다 VAlign 전체 행에 있는 셀 내용의 세로 맞춤을 제어 하는 속성입니다.

<%@ Page Language="C#" AutoEventWireup="True" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

  void Button_Click(Object sender, EventArgs e)
  {

    // Iterate through the rows of the table.
    for (int i = 0; i <= Table1.Rows.Count - 1; i++)
    {

      // Update the properties of each row. 
      Table1.Rows[i].Align = AlignSelect.Value;
      Table1.Rows[i].VAlign = VAlignSelect.Value;

    }

  }

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
   <title>HtmlTableRow Example</title>
</head>
<body>

   <form id="form1" runat="server">

      <h3>HtmlTableRow Example</h3>

      <table id="Table1" 
             style="border-width:1; border-color:Black"
             runat="server">

         <tr>
            <td>
               Here is some content for Cell 1.
            </td>
            <td>
               Here is some content for Cell 2.
            </td>
         </tr>
         <tr>
            <td style="width:100; height:100">
               Here is some content for Cell 3.
            </td>
            <td style="width:100; height:100">
               Here is some content for Cell 4.
            </td>
         </tr>

      </table>

      <hr />

      Select the display settings for the cells in the table: <br /><br />

      Align:
      <select id="AlignSelect" 
              runat="server">

         <option value="Left" selected="selected">Left</option>
         <option value="Center">Center</option>
         <option value="Right">Right</option>
        
      </select>

        

      VAlign:
      <select id="VAlignSelect" 
              runat="server">

         <option value="Top">Top</option>
         <option value="Middle" selected="selected">Middle</option>
         <option value="Bottom">Bottom</option>

      </select>
       
      <br /><br />
  
      <input type="button" 
             value="Generate Table"
             onserverclick="Button_Click" 
             runat="server"/>

   </form>

</body>
</html>
<%@ Page Language="VB" AutoEventWireup="True" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

  Sub Button_Click(ByVal sender As Object, ByVal e As EventArgs)

    Dim i As Integer

    ' Iterate through the rows of the table.
    For i = 0 To Table1.Rows.Count - 1
       
      ' Update the properties of each row. 
      Table1.Rows(i).Align = AlignSelect.Value
      Table1.Rows(i).VAlign = VAlignSelect.Value

    Next i

  End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
   <title>HtmlTableRow Example</title>
</head>
<body>

   <form id="form1" runat="server">

      <h3>HtmlTableRow Example</h3>

      <table id="Table1" 
             style="border-width:1; border-color:Black"
             runat="server">

         <tr>
            <td>
               Here is some content for Cell 1.
            </td>
            <td>
               Here is some content for Cell 2.
            </td>
         </tr>
         <tr>
            <td style="width:100; height:100">
               Here is some content for Cell 3.
            </td>
            <td style="width:100; height:100">
               Here is some content for Cell 4.
            </td>
         </tr>

      </table>

      <hr />

      Select the display settings for the cells in the table: <br /><br />

      Align:
      <select id="AlignSelect" 
              runat="server">

         <option value="Left" selected="selected">Left</option>
         <option value="Center">Center</option>
         <option value="Right">Right</option>
        
      </select>

        

      VAlign:
      <select id="VAlignSelect" 
              runat="server">

         <option value="Top">Top</option>
         <option value="Middle" selected="selected">Middle</option>
         <option value="Bottom">Bottom</option>

      </select>
       
      <br /><br />
  
      <input type="button" 
             value="Generate Table"
             onserverclick="Button_Click" 
             runat="server"/>

   </form>

</body>
</html>

설명

사용 합니다 VAlign 의 행 셀에 있는 내용의 세로 맞춤을 지정 하는 속성을 HtmlTable 컨트롤입니다.

참고

인스턴스에서 나타내는 테이블의 행에 있는 모든 셀에 영향을 줍니다이 속성을 설정 합니다 HtmlTableRow 클래스입니다. 맞춤 특성 행의 단일 셀에 적용할 설정 된 VAlign 해당 셀에 대 한 속성입니다.

다음 표에서이 속성에 사용할 수 있는 값을 나열 합니다.

설명
Top 셀의 위쪽 가장자리와 셀의 내용을 정렬합니다.
Middle 셀의 가운데에 있는 셀의 내용을 맞춥니다.
Bottom 셀의 아래쪽 가장자리와 셀의 내용을 정렬합니다.

참고

사용할 수도 있습니다 BaseLine 이 속성에 대 한 값으로. 그러나 일부 브라우저는이 기능을 지원 합니다.

적용 대상

추가 정보