HtmlTableCellCollection.Remove メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HtmlTableCellCollection.Remove メソッドの意味・解説 

HtmlTableCellCollection.Remove メソッド

指定した HtmlTableCell オブジェクトHtmlTableCellCollection コレクションから削除します

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

Public Sub Remove ( _
    cell As HtmlTableCell _
)
Dim instance As HtmlTableCellCollection
Dim cell As HtmlTableCell

instance.Remove(cell)
public void Remove (
    HtmlTableCell cell
)
public:
void Remove (
    HtmlTableCell^ cell
)
public void Remove (
    HtmlTableCell cell
)
public function Remove (
    cell : HtmlTableCell
)

パラメータ

cell

HtmlTableCellCollection から削除する HtmlTableCell。

解説解説

このメソッド使用して指定した HtmlTableCell オブジェクトHtmlTableCellCollection コレクションから削除します

メモメモ

HtmlTableCellCollection コレクション存在しない HtmlTableCell オブジェクト指定した場合、項目はコレクションから削除されません。

使用例使用例

Remove メソッド使用してHtmlTableCellCollection コレクションから HtmlTableCell オブジェクトが表すテーブル指定したセル削除する方法次のコード例示します。この例では 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 cell As HtmlTableCell

    ' Iterate through the rows of the table.
    For i = 0 To Table1.Rows.Count - 1
 
      ' Remove the cells from the first column.
      cell = Table1.Rows(i).Cells(0)
      Table1.Rows(i).Cells.Remove(cell)

    Next i

  End Sub

</script>

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

   <form runat="server">

      <h3>HtmlTableCellCollection Example</h3>

      <table id="Table1" 
             border="1" 
             bordercolor="black" 
             runat="server">

         <tr>
            <td>
               Cell 1
            </td>
            <td>
               Cell 2
            </td>
         </tr>
         <tr>
            <td>
               Cell 3
            </td>
            <td>
               Cell 4
            </td>
         </tr>

      </table>

      <br><br>
  
      <input type="button" 
             value="Remove First Column from 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++)
    {

      // Remove the cells from the first column.
      HtmlTableCell cell = Table1.Rows[i].Cells[0];
      Table1.Rows[i].Cells.Remove(cell);

    }

  }

</script>

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

   <form runat="server">

      <h3>HtmlTableCellCollection Example</h3>

      <table id="Table1" 
             border="1" 
             bordercolor="black" 
             runat="server">

         <tr>
            <td>
               Cell 1
            </td>
            <td>
               Cell 2
            </td>
         </tr>
         <tr>
            <td>
               Cell 3
            </td>
            <td>
               Cell 4
            </td>
         </tr>

      </table>

      <br><br>
  
      <input type="button" 
             value="Remove First Column from Table"
             onserverclick="Button_Click" 
             runat="server"/>

   </form>

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

<script runat="server">

  function Button_Click(sender : Object, e : EventArgs) 
  {

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

      // Remove the cells from the first column.
      var cell : HtmlTableCell = Table1.Rows[i].Cells[0];
      Table1.Rows[i].Cells.Remove(cell);

    }

  }

</script>

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

   <form runat="server">

      <h3>HtmlTableCellCollection Example</h3>

      <table id="Table1" 
             border="1" 
             bordercolor="black" 
             runat="server">

         <tr>
            <td>
               Cell 1
            </td>
            <td>
               Cell 2
            </td>
         </tr>
         <tr>
            <td>
               Cell 3
            </td>
            <td>
               Cell 4
            </td>
         </tr>

      </table>

      <br><br>
  
      <input type="button" 
             value="Remove First Column from Table"
             onserverclick="Button_Click" 
             runat="server"/>

   </form>

</body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HtmlTableCellCollection クラス
HtmlTableCellCollection メンバ
System.Web.UI.HtmlControls 名前空間
RemoveAt
Cells
HtmlTableRow


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

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

辞書ショートカット

すべての辞書の索引

HtmlTableCellCollection.Remove メソッドのお隣キーワード
検索ランキング

   

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



HtmlTableCellCollection.Remove メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS