根据table随时添加列

var newRow = '<tr align="center" class="tdbg" id="tr'+temp[0]+'">'+
                    '<td nowrap="nowrap">'+
                    '    <input type="checkbox" name="checkbox_2" id="tcheckbox_'+temp[0]+'" value="'+temp[0]+'" class="chebox" checked="checked"/>'+
                    '</td>'+
                    '<td>'+temp[1]+'</td>'+
                    '<td>'+temp[2]+'</td>'+
                    '<td>'+temp[3]+'</td>'+
                    '<td>'+temp[4]+'</td>'+
                    '<td align="right">'+parseFloat(temp[5]).toFixed(2)+'</td>'+
                    '<td>'+temp[6]+'</td>'+
                    '<td>'+temp[7]+'</td>'+
                    '<td><a href="javascript:void(0)" onclick="delTR('+temp[0]+')">取消</a></td>';

                
                    $('#table0 tr:last').after(newRow);    
                    $('#table0').show();
                    $('#table0.adv_query_list tr.tdbg:odd').addClass('tdbg_even');//格行换色
<table id="table0" class="adv_query_list">
                        <tr class="search_title_show" >
                            <td align="center">选择</td>
                            <td align="center">1</td>
                            <td align="center">2</td>
                            <td align="center">3</td>
                            <td align="center">4</td>
                            <td align="center">5</td>
                            <td align="center">6</td>
                            <td align="center">7</td>
                            <td align="center">8</td>
                        </tr>
                        <!--                         通过js添加 -->
                        
                </table>

 

posted @ 2015-03-11 11:58  也许还年轻  阅读(163)  评论(0编辑  收藏  举报