datagrid表头颜色样式
<style>
.datagrid-header-row td{background-color:blue;color:#fff}
</style>
datagrid对齐方式一
$(function () {
$('.datagrid-cell').css("text-align", "center"); //使表头居中
});
datagrid对齐方式二
<table id="dg" class="easyui-datagrid" style="width:100%;height:auto" data-options="rownumbers: true,pagination:true,pageSize:20,striped: true, singleSelect: true, method: 'get' ">
<thead>
<tr>
...
<th data-options="field:'专业名称',align: 'center', halign: 'center'">专业名称</th>
<th data-options="field:'请购单版本号',align: 'center', halign: 'center'" style="text-align:center">请购单版本号</th>
<th data-options="field:'列出所属包所有项',align: 'center', halign: 'center'">列出所属包所有项</th>
<th data-options="field:'按管道材料等级分项',align: 'center', halign: 'center'">按管道材料等级分项</th>
</tr>
</thead>
</table>
其中 align:’center’ 控制内容居中 , halign: ‘center’ 控制标题居中。