EasyUI的columns中列标题居中

$("#supDataList").datagrid({
   url: "../Ajax/SupplierAjax.ashx",
   queryParams:
  {
   cmd: "getSup",
   strWhere: strWhere
  },
  fitColumns: true,//真正的自动展开/收缩列的大小,以适应网格的宽度,防止水平滚动。
  pagination: true, //允许分页
  rownumbers: true, //行号
  singleSelect: false,//true只能选择一行
  striped: true, //奇偶行是否区分
  checkOnSelect: true,
  onDblClickRow: function (rowIndex, rowData) {//双击一行时触发
 
         EditSup(rowData.sup_Id, rowData.sd_DeId);//编辑 
  },
  pageSize: 50, //设置默认每页20条记录
  pageList: [10, 50, 100, 1000, 5000],//可自定义每页显示多少条记录

  columns: [[
  {
     field: "row",
     checkbox: true
  },
  {
      field: "sup_Id",
      title: "操作",
      align: "center",
      "60",
     formatter: function (value, row, index) {
        var str = "<a id='deepRed' href='javascript:void(0)' onclick='DelSup(" + row.sup_Id + "," + row.sd_DeId + ")' title='删除' >✘</a>&nbsp;&nbsp;&nbsp;&nbsp;<a id='green'          href='javascript:void(0)' onclick='EditSup(" + row.sup_Id + "," + row.sd_DeId + ")' title='编辑'>➷</a>";
                   return str;
     }
   },
  {
   field: "sup_Code",
   title: "编码",
   align: "center",
    "90"
  },
  {
   field: "sup_Name",
   title: '<span class="txtcenter">名称</span>',
    "200"
   },
 
 ]],
 onLoadSuccess: function (data) {
 $(".txtcenter").parent().parent().css("text-align", "center");
 },

});

原文地址:https://www.cnblogs.com/weimingxin/p/7088261.html