jquery ui动态添加table样式表不起作用
if (!$("#"+a.stepCategoryId).length > 0){
$('#recordSaveDiv').tabs('add',{
id:a.stepCategoryId,
title:a.stepCategoryName,
content:'<div id="'+a.stepCategoryId+'Div"/>',
closable:true
});
//创建table
var $table=$('<table id="'+a.stepCategoryId+'Table" class="easyui-datagrid"><thead><tr><th>描述</th><th>说明</th><th>要求</th></tr></thead></table>');
$("#"+a.stepCategoryId+"Div").append($table);
$("#"+a.stepCategoryId+"Table").css("class","easyui-datagrid") ;
$("#"+a.stepCategoryId+"Table").css("border","1px solid red") ;
}
我写了个固定的<table id="test" class="easyui-datagrid" fit="true"> 这样的样式 可以显示样式没有问题。开始我动态的就没有显示,很奇怪的是$("#"+a.stepCategoryId+"Table").css("border","1px solid red") ; 这句话起作用。我在table里面写class=“easyui-datagrid” 就不起作用