$.each(json.people, function (key, val) {
        for (k in this) tHead += "<td class='bg_thead pl_10'>" + this[k] + "</td>";
    });
改为
$.each(json.people[0], function (key, val) {
        for (k in this) tHead += "<td class='bg_thead pl_10'>" + this[k] + "</td>";
    });

解决方案 »

  1.   


    $.each(json.people, function (key, val) {
            for (k in  val) tHead += "<td class='bg_thead pl_10'>" + this[k] + "</td>";
        });
    这样?
      

  2.   

    $("#tbItem thead").html(tHead);?
      

  3.   

    我在火狐下运行没问题,你试一下把tHead += "<td class='bg_thead pl_10'>序号</td>"后面的分号加上
      

  4.   


        $("#tbItem thead").append(tHead);
        alert($("#tbItem thead").html());
    加这句看看dom有元素没有,有就是和#9说的,第一列被隐藏了,firebug或者chrome开发工具看看有什么css作用到那个元素上了,或者被其他js代码移除了
      

  5.   

    append 和 html 在IE9下面都没问题。 序号 姓名 手机 
      

  6.   

    LZ那个people的数据格式可以改改
    方法一:var json    =   { "people": { "Col01": "姓名","Col02": "手机"}};改成这样,不要采用数据,省得还得取个下村
     $(function(){
         
        var json    =   { "people": { "Col01": "姓名","Col02": "手机"}}, 
            tHead   =   "<tr><td class='bg_thead pl_10'>序号</td>"; 
            
        $.map(json.people,function(v){
            tHead += "<td class='bg_thead pl_10'>" + v + "</td>"; 
        });
              
        tHead += "</tr>"; 
        
        alert(tHead); 
        $("#tbItem thead").append(tHead);});方法二:var json    =   { "people": ["姓名","手机","身份证"]};直接使用数组,反正你那些什么Col01什么的都没用到过
    $(function(){
        var json    =   { "people": ["姓名","手机","身份证"]}, 
            tHead   =   "<tr><td class='bg_thead pl_10'>序号</td><td class='bg_thead pl_10'"
                        + json.people.join("</td><td class='bg_thead pl_10'>")
                        + "</td></tr>"; 
        alert(tHead); 
        $("#tbItem thead").append(tHead);
    })
      

  7.   

    上面少打了个>,应该是:
    <script type="text/javascript"> 
    $(function(){
        var json    =   { "people": ["姓名","手机","身份证"]}, 
            tHead   =   "<tr><td class='bg_thead pl_10'>序号</td><td class='bg_thead pl_10'>"
                        + json.people.join("</td><td class='bg_thead pl_10'>")
                        + "</td></tr>"; 
        alert(tHead); 
        $("#tbItem thead").append(tHead);
    })
    </script>
    <table id="tbItem">
    <thead>
    </thead>
    </table>