日期:2014-05-16 浏览次数:20440 次
<body> <table width="100%" border="0" id="table"> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> <td>8</td> <td>8</td> <td>10</td> <td>11</td> <td>12</td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> <td>8</td> <td>8</td> <td>10</td> <td>11</td> <td>12</td> </tr> </table> </body> </html> <script src="js/jquery-1.4.2.min.js"></script> <script> var tr_str=""; for(var k=0;k<$("tr").length;k++) { var td_str=""; var td_len=$("tr:eq(" + k +") td").length; for(var i=0;i<td_len;i++) { if(i==0 || (i+1)%3 == 1) td_str = td_str + "<td>" + $("td").eq(i).html() + "</td>" ; } tr_str = tr_str + "<tr>" + td_str + "</tr>" } $("table").html(tr_str); </script>
------解决方案--------------------
合并单元格例子
http://www.jeasyui.com/tutorial/datagrid/datagrid13.php