2013-08-23 24 views
0

我想刪除最後一行。刪除嵌套div中的最後一行表格

我有潛水內div,其中有表和許多行。

我想刪除表格的最後一行。我無法迭代到最後一個tr。

<div class="span15" id="MURWorksheetPage2"> 
       <div class="span8"> 
        <table> 
         <tr> 
          <td class="col1"> 
           @Html.DisplayNameFor(model => model.MedicineUseNo) @Html.TextBoxFor(model => model.MedicineUseNo, new { id = "txtMedicineUseNo", style = "Width:20px" }) 

          </td> 
          <td class="col2">@Html.DisplayNameFor(model => model.MedicinePrescribed) @Html.TextBoxFor(model => model.MedicinePrescribed, new { id = "txtMedicinePrescribed" })</td> 
         </tr> 
         <tr> 
          <td class="col1" colspan="2"> 
           @Html.DisplayNameFor(model => model.OTC) @Html.TextBoxFor(model => model.OTC, new { id = "txtOTC" }) 

          </td> 
         </tr> 
</table> 
       </div> 
      </div> 
+0

表明你已經嘗試 –

+0

不管我曾試圖從過去的2小時內,我很努力爲同我刪除。 –

回答

0

未測試,但這應該工作。

$('#MURWorksheetPage2 div table :last').remove(); 
+0

昨天更新了我的頁面 –

+0

有這麼多的跨度8。 –