{% raw %}
<table class="table table-striped table-bordered row" id="compare-table" style = "table-layout: fixed; margin-right: auto; margin-left: auto">
<thead>
<th class = "col-md-3 tableHeading">Configuration name</th>
<th class = "col-md-3 tableHeading">Property Name</th>
<th class = "col-md-3 tableHeading">Value 1</th>
<th class = "col-md-3 tableHeading">Value 2 </th>
</thead>
<tbody>
{{#each tableRows }}
{{#each values}}
<tr>
{{#if @first}}
<th class="breakWord inlineHeading" rowspan={{../length}}>{{ ../pid }}</th>
{{/if}}
<td class="breakWord">{{ propName }}</td>
<td class="breakWord">{{ propValueA }}</td>
<td class="breakWord">{{ propValueB }}</td>
</tr>
{{/each}}
{{/each}}
</tbody>
</table>
{% endraw %}
我需要在ajax请求后动态渲染表格,并根据配置名称分组行。当我在Data Table中使用rowspan时,只会呈现简单的表格,并出现控制台错误:
jquery.dataTables.min.js:24 Uncaught TypeError:无法将未定义的属性'_DT_CellIndex'设置为
我正在使用handlebars.js来填充Table-Template
DATATABLE: https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"> https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap.min.js">
有没有一种方法可以在保持Datatable功能的同时以这种格式生成表格。
<th rowspan="2">名称</th>
- Sumesh TG