Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
151
rated 0 times [  156] [ 5]  / answers: 1 / hits: 34640  / 9 Years ago, fri, july 17, 2015, 12:00:00

How can I remove a td cell in a table with MVC4?



Could I use JQuery or JavaScript? And if so, how?



<table class=table table-striped table-bordered table-hover id=tblParticipantList>
<thead>
<tr>
<th>Name</th>
<th>Adress</th>
<th>Redeem Code</th>
</tr>
</thead>
<tbody>
<tr data-id=columnId id=customerPartial_94>
<td data-field=NAME>Attn Donna</td>
<td data-field=ADDRESS>3046 Lavon Drive Newyork America 7504</td>
<td data-field=SECURITY_REDEMPTION_CD></td>
</tr>
<tr data-id=columnId id=customerPartial_95>
<td data-field=NAME>F 1 La 1</td>
<td data-field=ADDRESS>Asd 1 s 1 Ci 1 s</td>
<td data-field=SECURITY_REDEMPTION_CD></td>
</tr>
</tbody>
</table>

More From » jquery

 Answers
21

To remove TD item, you should know exactly td what you want to remove.




  1. Remove All TD item



    $('#tblParticipantList > tr > td').remove();

  2. Remove TD at specified Row



    $('#tblParticipantList > tr').eq(rowNum).children('td').remove();

  3. Remove TD at specified Row and Column



    $('#tblParticipantList > tr').eq(rowNum).children('td').eq(colNum).remove();


[#65775] Wednesday, July 15, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kalaveronicab

Total Points: 3
Total Questions: 100
Total Answers: 105

Location: Guam
Member since Fri, Jun 18, 2021
3 Years ago
;