我使用for循环创建了一个html表格,该表格在jsp中动态创建表格。合并表格行html
下面是一段代码。
的Java for循环:
for(int i=0; i<mleFIPStepsInfo.size(); i++)
{
Map map = (Map) mleFIPStepsInfo.get(i);
的html代码:
<tr>
<td style="text-align: center;" rowspan=4><span style="font-size:13px;"><strong><span style="font-family:calibri;"><%=map.get("attribute[Sequence]")%> </td>
<td style="text-align: center;"><span style="font-size:13px;"><strong><span style="font-family:calibri;"><%=map.get("name")%> </td>
<td style="text-align: center;"><span style="font-size:13px;"><strong><span style="font-family:calibri;"><%=map.get("description")%> </td>
<td style="text-align: center;"><span style="font-size:13px;"><strong><span style="font-family:calibri;"><%=map.get("attribute[Instructions]")%> </td>
</tr>
现在我有10条记录。
前5条记录序号为1,其他为2,3,4,5,6。我现在想用10行建立一个和我应该先5行合并象下面这样:
序列名称说明参考
Name1 Description1 Instructions1
Name2 Description2 Instructions2
1 NAME3 Description3指令3
Name4 Description4 Instructions4
Name5 Description5 Instructions5
2名称6说明6说明6
3名称7说明7说明7
4 Name8 Description8 Instructions8
5 Name9 Description9 Instructions9
6 Name10 Description10 Instructions10
我能不能够正确地在这里StackOverflow上打印的表,但我基本上需要的是在第5行需要与序列号1合并。
不清楚你想要什么它最后的样子。你希望前5行显示为一行吗? – 2014-10-09 19:30:20
感谢您的快速响应。我基本上需要的是前5行合并列1是序列。我知道如果我保留rowspan =“5”和colspan =“1”,这将使前5行合并,但我无法生成相同的循环中的逻辑。 – Balu 2014-10-09 19:33:50
喜欢的东西:
名称2
名称3
...