HtmlTableRowCollection.Remove メソッド
アセンブリ: System.Web (system.web.dll 内)


このメソッドを使用して、指定した HtmlTableRow オブジェクトを HtmlTableRowCollection コレクションから削除します。
![]() |
---|
HtmlTableRowCollection に存在しない HtmlTableRow を指定した場合、項目はコレクションから削除されません。 |

Remove メソッドを使用して、HtmlTableRowCollection コレクションから、HtmlTableRow オブジェクトが表す指定したテーブルの行を削除する方法を次のコード例に示します。この例では HtmlTable コントロールの最初の行からセルを削除します。
<%@ Page Language="VB" AutoEventWireup="True" %> <script runat="server"> Sub Button_Click(ByVal sender As Object, ByVal e As EventArgs) ' Remove the first row from the table. Dim row As HtmlTableRow = Table1.Rows(0) Table1.Rows.Remove(row) End Sub </script> <html> <head> <title>HtmlTableRowCollectionExample</title> </head> <body> <form runat="server"> <h3>HtmlTableRowCollection 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 Row 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) { // Remove the first row from the table. HtmlTableRow row = Table1.Rows[0]; Table1.Rows.Remove(row); } </script> <html> <head> <title>HtmlTableRowCollectionExample</title> </head> <body> <form runat="server"> <h3>HtmlTableRowCollection 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 Row from Table" onserverclick="Button_Click" runat="server"/> </form> </body> </html>
<%@ Page Language="JScript" AutoEventWireup="True" %> <script runat="server"> function Button_Click(sender, e : EventArgs) { // Remove the first row from the table. var row : HtmlTableRow = Table1.Rows[0]; Table1.Rows.Remove(row); } </script> <html> <head> <title>HtmlTableRowCollectionExample</title> </head> <body> <form runat="server"> <h3>HtmlTableRowCollection 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 Row from Table" onserverclick="Button_Click" runat="server"/> </form> </body> </html>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からHtmlTableRowCollection.Remove メソッドを検索する場合は、下記のリンクをクリックしてください。

- HtmlTableRowCollection.Remove メソッドのページへのリンク