名字相同的合并单元格

遍历list,有属性name,filmdate,将名字和日期相同的合并单元格
<logic:present name="list">
				<table border="1" id="filmTable">
					<logic:iterate id="list" name="list">
					<tr>
							
							<td >
							<bean:write name="list" property="name" />
							</td>
							<td>
							<bean:write name="list" property="filmdate" />
							</td>
							<td>
							<bean:write name="list" property="filmtime" />
							</td>
							<td>
							<bean:write name="list" property="hallid" />
							</td>
							<td>
							<a href="#" onclick="fixTicket('<bean:write name='list' property='hallid' />','<bean:write name='list' property='filmdate' />')">订票</a>
							</td>
							</tr>
							</logic:iterate>
				</table>
		</logic:present>


js代码:
function reload(){
		var table = document.getElementById("filmTable");
		for(i=0;i<table.rows.length-1;i++){
			for(j=i+1;j<table.rows.length;j++){
				if(table.rows[i].cells[0].innerHTML==table.rows[j].cells[0].innerHTML){
					table.rows[j].deleteCell(0);
					table.rows[i].cells[0].rowSpan++;
					if(table.rows[i].cells[1].innerHTML==table.rows[j].cells[0].innerHTML){
						table.rows[j].deleteCell(0);
						table.rows[i].cells[1].rowSpan++;
					}
				}
			}
		}
	}

你可能感兴趣的:(java,J#)