HtmlTableCell.Align プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HtmlTableCell.Align プロパティの意味・解説 

HtmlTableCell.Align プロパティ

HtmlTableCell クラスインスタンスが表すセル内容平方向の配置取得または設定します

名前空間: System.Web.UI.HtmlControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

解説解説
使用例使用例

Align プロパティ使用して、HtmlTable コントロールセル内容配置プログラム制御するコード例次に示します

<%@ Page Language="VB" AutoEventWireup="True"
 %>

 <script runat="server">
   
   Sub Button_Click(ByVal sender As
 Object, ByVal e As EventArgs)

     Dim i As Integer
     Dim j As Integer

     ' Iterate through the rows of the table.
     For i = 0 To Table1.Rows.Count - 1

       ' Iterate through the cells of a row.
       For j = 0 To Table1.Rows(i).Cells.Count
 - 1
           
         ' Update the properties of each cell. 
         Table1.Rows(i).Cells(j).Align = AlignSelect.Value
         Table1.Rows(i).Cells(j).NoWrap = Convert.ToBoolean(NoWrapSelect.Value)
         Table1.Rows(i).Cells(j).VAlign = VAlignSelect.Value

       Next j

     Next i

   End Sub

</script>

<html>
<head>
   <title>HtmlTableCell Example</title>
</head>
<body>

   <form runat="server">

      <h3>HtmlTableCell Example</h3>

      <table id="Table1" 
             border="1" 
             bordercolor="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 width="100" height="100">
               Here is some content for Cell
 3.
            </td>
            <td 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>Left</option>
         <option value="Center">Center</option>
         <option value="Right">Right</option>
        
      </select>

      &nbsp;&nbsp;

      NoWrap:
      <select id="NoWrapSelect" 
              runat="server">

         <option value="true">True</option>
         <option value="false" selected>False</option>

      </select>

      &nbsp;&nbsp;

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

         <option value="Top">Top</option>
         <option value="Middle" 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="C#" AutoEventWireup="True" %>

<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++)
    {

      // Iterate through the cells of a row.
      for (int j = 0; j <= Table1.Rows[i].Cells.Count
 - 1; j++)
      {
        // Update the properties of each cell. 
        Table1.Rows[i].Cells[j].Align = AlignSelect.Value;
        Table1.Rows[i].Cells[j].NoWrap = Convert.ToBoolean(NoWrapSelect.Value);
        Table1.Rows[i].Cells[j].VAlign = VAlignSelect.Value;
      }

    }

  }

</script>

<html>
<head>
   <title>HtmlTableCell Example</title>
</head>
<body>

   <form runat="server">

      <h3>HtmlTableCell Example</h3>

      <table id="Table1" 
             border="1" 
             bordercolor="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 width="100" height="100">
               Here is some content for Cell 3.
            </td>
            <td 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>Left</option>
         <option value="Center">Center</option>
         <option value="Right">Right</option>
        
      </select>

      &nbsp;&nbsp;

      NoWrap:
      <select id="NoWrapSelect" 
              runat="server">

         <option value="true">True</option>
         <option value="false" selected>False</option>

      </select>

      &nbsp;&nbsp;

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

         <option value="Top">Top</option>
         <option value="Middle" 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>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HtmlTableCell クラス
HtmlTableCell メンバ
System.Web.UI.HtmlControls 名前空間
String.Empty
HtmlTable クラス
ColSpan
NoWrap
RowSpan
VAlign
その他の技術情報
HTML サーバー コントロール


このページでは「.NET Framework クラス ライブラリ リファレンス」からHtmlTableCell.Align プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からHtmlTableCell.Align プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からHtmlTableCell.Align プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「HtmlTableCell.Align プロパティ」の関連用語

HtmlTableCell.Align プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



HtmlTableCell.Align プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS