循环
<table>
  <tr>
  <th>姓名</th>
  <th>年龄</th>
  <th>备注</th>
  </tr>
  <tr>
  <td>张三</td>
  <td>23</td>
  <td><a href="javascript:;" onclick="show_re(这里是一个动态ID)">查看<a></td>
  </tr>
  <tr id="action_list这里是一个动态ID" style="display:none">
    <td colspan="3">
      <table>
        <tr>备注一</tr>
      <table>
    </td>
  </tr>
</table>
function cs_show_re(orderId){
var ac_list = document.getElementById("action_list"+orderId);

if (ac_list.style.display != "block") {
ac_list.style.display = "block";
} else {
ac_list.style.display = "none";
}
}循环结束
请问大家,为什么我显示点击   查看    之后,备注里的td单元格就不合并了啊?
如图:

解决方案 »

  1.   

    <tr>备注一</tr>里面需要加td才能显示内容
      

  2.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    </head>
    <script type="text/javascript">
    function cs_show_re(){
    var ac_list = document.getElementById("action_list"); if (ac_list.style.display != "block") {
    ac_list.style.display = "block";
    } else {
    ac_list.style.display = "none";
    }
    }
    </script>
    <body>
    <div> <table>
      <tr>
      <th>姓名</th>
      <th>年龄</th>
      <th>备注</th>
      </tr>
      <tr>
      <td>张三</td>
      <td>23</td>
      <td><a href="javascript:void(0);" onclick="cs_show_re()">查看</a></td>
      </tr>
      <tr id="action_list" style="display:none">
      <td colspan="3">
      <table>
       <tr style="background-color: red;"><td> 备注一fdsfdsfsdfdsfsdfsd</td></tr>
      </table>
      </td>
      </tr>
    </table>
    </div>
    </body>
    </html>
      

  3.   

    2楼正解,
    你的javascript把<script type="text/javascript"></script>标签带着,
    还有onclick事件的方法名和function的方法名不一致哦,
    还有就是那个备注那块的html格式不标准,少个<td></td>