我怎么能够把囚室合并到一个桌子里,使用拉扎尔角的浏览器?
- Without using javascript/jQuery.
- The table s source is an IEnumerable.
- Some of the items in the source will have the same value in a certain field and those are the one we want to merge in one cell.
- We don t know how many times a given value is repeated.
由此形成的超文本应当如此:
<table>
<tr>
<td rowspan="2">Column 1 row 1</td>
<td>Column 2 row 1</td>
</tr>
<tr>
<td>Column 2 row 2</td>
</tr>
<tr>
<td rowspan="3">Column 1 row 3</td>
<td>Column 2 row 3</td>
</tr>
<tr>
<td>Column 2 row 4</td>
</tr>
<tr>
<td>Column 2 row 5</td>
</tr>
</table>
EDIT增加数据来源和预期结果:
数据来源可能类似于具有类别的产品。 注
Categories
- Electronics
- Groceries
Products
- Laptop (Electronics)
- iPod (Electronics)
- TV (Electronics)
- Coffee (Groceries)
- Cookies (Groceries)
The result
╔═════════════╦════════╗
║ Electronics ║ Laptop ║
║ ║ iPod ║
║ ║ TV ║
╠═════════════╬════════╣
║ Groceries ║ Coffee ║
║ ║ Cookies║
╚═════════════╩════════╝
我所想的唯一方式是利用林克来计算其价值多少倍,但我想知道,有人是否有一个更好的解决办法。 感谢!