function TableCss(data){ var str = "<div id='TableCss'>" //+"<link href='../css/modelBase.css' rel='stylesheet' type='text/css'>" //+"<link href='css/Hr.css' rel='stylesheet' type='text/css'>" + "<table cellspacing='0' cellpadding='0' border='1' width='100%' class='dataTable'>" + "<thead><tr><td>序号</td><td>姓名</td><td>工号</td><td>部门</td><td>岗位</td></tr></thead>"; for(var i = 0; i < data.length; i++){ str += "<tbody>" + "<tr>" + "<td>"+(i+1)+"</td>" + "<td>"+data[i].username+"</td>" + "<td>"+data[i].number+"</td>" + "<td>"+data[i].postname+"</td>" + "<td>"+data[i].station+"</td>" + "</tr>" + "</tbody>"; } +"</div>"; return str;} $(".HrList .Print").click(function(){ var str = TableCss(data); $(".HrList").html(str); $("#TableCss").PrintArea(); var main = Hr.style2(data); Hr.hrList(d); }); 可以调用浏览器的打印功能,但没有样式。咋回事这是?
1 回答
斜风戏雨
TA贡献3条经验 获得超0个赞
//+"<link href='../css/modelBase.css' rel='stylesheet' type='text/css'>"
//+"<link href='css/Hr.css' rel='stylesheet' type='text/css'>"
你这不是把样式文件的引用注释了吗?
添加回答
举报
0/150
提交
取消