与meteor的AutoForm的可编辑表
我怎样才能在meteor中创build一个带有input字段的表格。 我已经使用http://autoform.meteor.com/update-each的例子,但他们只使用1input字段。
该function适用于此代码:
<tbody> {{#each persons}} {{#autoForm id=makeUniqueID type="update" collection=Collections.Persons doc=this autosave=true}} <tr> <td>{{> afFieldInput name="fullName" label=false}}</td> <td>{{> afFieldInput name="email" label=false}}</td> <td>{{> afFieldInput name="address" label=false}}</td> <td><button type="submit" class="btn btn-xs btn-danger">Delete</button></td> </tr> {{/autoForm}} {{/each}} </tbody>
但是它在每个<tr>
周围都创build了一个<form>
元素,它把我的html搞砸了。 什么是正确的方法来做到这一点?
在CSS中使用div
:
<div class="table"> {{#each persons}} {{autoform class="tr"}} <div class="td">{{> afQuickField}}</div> <div class="td">{{> afQuickField}}</div> <div class="td">{{> afQuickField}}</div> {{/autoform}} {{/each}} </div>
它的样式如下:
.table { display: table; } .tr { display: table-row; } .td { display: table-cell }