I'm using Node.js, Jade and Bootstrap. I need to render a table and on every line i need a seperate form. I tried this:
- for(var i = 0; i < renditeTabellen.length; ++i) {
tr
form(method="POST", action="/deleteTable")
td#tableID #{i}
td#tableName #{renditeTabellen[i].name}
td#tableDate nix
td
button#delete.btn-danger(type="submit") Speichern
- }
But i get this output:

so the form is not nesting in the right way. It should contain a tr
What am I doing wrong?
You can't put a form directly to TR. Change it to render form in a single td. As far as I can see, you do not even need to have a form wrapping all TDs in row. Suppose code should be like this:
- for(var i = 0; i < renditeTabellen.length; ++i) {
tr
td#tableID #{i}
td#tableName #{renditeTabellen[i].name}
td#tableDate nix
td
form(method="POST", action="/deleteTable")
button#delete.btn-danger(type="submit") Speichern
- }
Also, remember that only form elements (input, select, button etc.) are submitted with a form, so you need to place a value attribute on your button which should contain an ID of an item that should be deleted. Plus, button should have a name, so you can get it from post.