<p>It can be done, but only by saving the table field's data completely. There's no controller method to remove a table's row(s). Same would apply for a table within a Matrix block, or for a Matrix block itself. All content gets saved by calling the entries controller (saveEntry) with the new content in a POST.</p>

<p>What you could do: Let your users create one or more matrix blocks, create your own plugin, create a controller with an <code>actionDeleteMatrixBlockById()</code> method (for instance) and let that controller call <code>craft()-&gt;matrix-&gt;deleteBlockById()</code> if one of the blocks has to be deleted.</p>

<p>Bit of a hassle, though. Don't know your use-case, but seems a bit overkill.</p>

CC BY-SA 3.0
2015-03-23T20:12:31.847Z
Is this the same with Matrix rows??
Sam Hibberd
CC BY-SA 3.0
2015-03-23T20:31:48.170Z
See the edit, I added some Matrix info.
Paul
CC BY-SA 3.0
2015-03-23T20:03:54.267Z
2015-03-23T20:31:21.940Z
2015-03-23T20:31:21.940Z
Paul
<p>I have a table field which is attached to users, before I go ahead and create the logic for adding rows on the front end via ajax, I need to know if I am going to be able to easily add the facility to delete specific rows (ideally without saving all the data again each time)?</p>

<p>It may well be that depending on complexity that this is more suited to a matrix field or custom database tables via a plugin.</p>

<p>Either way can it be done?</p>

<frontend><table-field>
Can you delete rows from a table field on the front end?
# Can you delete rows from a table field on the front end?

(Asked by: username_0 on 2015-03-23)

I have a table field which is attached to users, before I go ahead and create the logic for adding rows on the front end via ajax, I need to know if I am going to be able to easily add the facility to delete specific rows (ideally without saving all the data again each time)?

It may well be that depending on complexity that this is more suited to a matrix field or custom database tables via a plugin.

Either way can it be done?

**Tags:** frontend, table-field


---

## 1 answers

### Answer by username_1 on 2015-03-23. Score: 2 | Accepted answer

It can be done, but only by saving the table field's data completely. There's no controller method to remove a table's row(s). Same would apply for a table within a Matrix block, or for a Matrix block itself. All content gets saved by calling the entries controller (saveEntry) with the new content in a POST.

What you could do: Let your users create one or more matrix blocks, create your own plugin, create a controller with an `actionDeleteMatrixBlockById()` method (for instance) and let that controller call `craft()->matrix->deleteBlockById()` if one of the blocks has to be deleted.

Bit of a hassle, though. Don't know your use-case, but seems a bit overkill.

> **Comments:**
> **username_0**: Is this the same with Matrix rows??  
> **username_1**: See the edit, I added some Matrix info.  

---

