我使用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
...