EasyUI Forum
September 13, 2025, 02:20:39 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to style datagrid column headers  (Read 14463 times)
kush
Newbie
*
Posts: 29


View Profile Email
« on: November 04, 2014, 03:04:37 AM »

Hi,
    I would like to style a specific column div element of ( datagrid-htable - >datagrid-header-row -> <td field="project_name" class="">
<div class="datagrid-cell datagrid-cell-c1-project_name" style="text-align: left;">)bold element .

I tried styler method like this.
{"field":"project_name","title":"project_name","sortable":true,"editor":"text","maxLength":100,"width":"9%","align":"left",styler: function(value,row,index){return 'text-overflow: ellipsis;color:red;';}}
But it is applied to body cells of that columns.
Please help me.


Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: November 04, 2014, 07:41:37 AM »

The simplest way to style the column title is to wrap a <span> element around the title.
Code:
<table class="easyui-datagrid" title="Basic DataGrid" style="width:700px;height:250px">
    <thead>
        <tr>
            <th data-options="field:'itemid',width:80">Item ID</th>
            <th data-options="field:'productid',width:100"><span style="font-weight:bold">Product</span></th>
        </tr>
    </thead>
</table>
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!