同じ名前の連結セル

1818 ワード

リストを巡って、属性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++;
					}
				}
			}
		}
	}