EasyUI Forum
July 19, 2025, 07:32:33 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Change background-color of entire column  (Read 2392 times)
btork
Newbie
*
Posts: 11


View Profile
« on: May 22, 2025, 05:14:20 PM »

How do I change the background color for a column?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2294


View Profile Email
« Reply #1 on: May 24, 2025, 06:21:35 AM »

Define the 'styler' function to set the CSS styles for the column.

Code:
    <script>
        function mystyler(){
            return 'background:#ddd'
        }
    </script>
<table id="tg" title="Folder Browser" class="easyui-treegrid" style="width:700px;height:250px"
data-options="
data:data,
rownumbers: true,
idField: 'id',
treeField: 'name'
">
<thead>
<tr>
<th data-options="field:'name',styler:mystyler" width="220">Name</th>
<th data-options="field:'size'" width="100" align="right">Size</th>
<th data-options="field:'date'" width="150">Modified Date</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!