为什么jqGrid的tableToGrid会在表格单元格中出现新的行字符时创建双倍高度的行?

时间:2011-09-16 19:50:30

标签: jquery jqgrid

我一直在尝试使用Windows平台上的tableToGrid函数将表转换为jqGrid。出于某种原因,如果有新的线符号,它会增加行高两次。有没有人知道它是一个功能还是bug?如何更改行为以忽略换行符以获得正常的行高?

<head>
    <script type="text/javascript">
         $(document).ready(function () {
             tableToGrid('#mytable', {
                caption: "My converted table!",
                pager: '#mypager',
                multiselect: true,
                height: 'auto',
                gridview: true
            });
        });
     </script>
</head>

<body>
     <table id="mytable" cellspacing=0 cellpadding=1 border=1>
        <thead>
        <tr>
                <th>Icon</th>
                <th>Platform</th>
                <th>Size</th>      
        </tr>
        </thead>
        <tbody>
        <tr>
                <td><img src="http://icons.iconarchive.com/icons/visualpharm/must-have/16/Properties-icon.png" alt=""></td>
                <td>PC</td>
                <td>12</td>
        </tr>
        <tr>
                <td>
          <img src="http://icons.iconarchive.com/icons/visualpharm/must-have/16/Properties-icon.png" alt="">
        </td>
                <td>Mac</td>
                <td>15</td>
        </tr>
        </tbody>
    </table>
     <div id="mypager"></div> 
 </body>
</html>

1 个答案:

答案 0 :(得分:0)

我遇到了类似的事情。您是否尝试将tablerow组合成一行,如下所示:

<tr><td><img src="http://icons.iconarchive.com/icons/visualpharm/must-have/16/Properties--con.png" alt=""></td><td>PC</td><td>12</td></tr>