<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="#" οnclick="fixTicket('<bean:write name='list' property='hallid' />','<bean:write name='list' property='filmdate' />')">
订票</a>
</td>
</tr>
</logic:iterate>
</table>
</logic:present>
<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="#" οnclick="fixTicket('<bean:write name='list' property='hallid' />','<bean:write
name='list' property='filmdate' />')">订票</a>
</td>
</tr>
</logic:iterate>
</table>
</logic:present>
js代码:
Java代码
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++;
}
}
}
}
}