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);
});
可以调用浏览器的打印功能,但没有样式。咋回事这是?
斜风戏雨