Tutorialsplane

Vue.Js Delete Table Row


Vue.Js Delete Table Row On Button Click We can remove the table row by index or id on button click very easily. Here in this article we are going to explain how you to delete the table row. You can also use our online editor to edit and run the code online.


Delete Table Row On Button Click in Vue.JS Example

Here in this example we have removed the table row by the row index, we have deleted the item at that index.

Example:




 


<div id="app">
	 <table>
<tr><th>Sample Table</th></tr>
<tr v-for="(content, index) in tableRows">
  <td>{{content}}</td><td><button>Delete</button></td>
</tr>
</table><br/>
 <button>Add New Row</button>
</div>
        


Try it ยป

If you run the above example it will produce the output something like this-