EasyUI Forum
May 15, 2024, 12:14:09 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: vertical-align on datagrid cell  (Read 7376 times)
jrnfs
Newbie
*
Posts: 16


View Profile Email
« on: June 15, 2015, 12:48:03 PM »

Hi,

How can I change the vertical-align to 'top' or 'bottom' instead of middle?

Is it possible? I found no reference.

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


View Profile Email
« Reply #1 on: June 15, 2015, 05:21:48 PM »

Use the column's 'formatter' function to format the values.
Code:
$('#dg').datagrid({
columns:[[
{field:'itemid',title:'ItemId',width:80,
formatter:function(value,row){
return '<div style="height:25px;line-height:12px">'+value+'</div>';
}
}
]]
})

or override the '.datagrid-body td' CSS style.
Code:
<style>
    .datagrid-body td{
        vertical-align: bottom;
    }
</style>
Logged
jrnfs
Newbie
*
Posts: 16


View Profile Email
« Reply #2 on: June 15, 2015, 05:37:29 PM »

tks,
Logged
jrnfs
Newbie
*
Posts: 16


View Profile Email
« Reply #3 on: June 16, 2015, 07:07:06 AM »

...btw, and how can I change the padding value of a column?
tks,
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: June 16, 2015, 05:18:09 PM »

Please try this:
Code:
<style>
    .datagrid-body td{
        vertical-align: bottom;
    }
    .datagrid-cell,
    .datagrid-cell-group,
    .datagrid-header-rownumber,
    .datagrid-cell-rownumber {
        padding:5px 6px;
    }
</style>
Logged
jrnfs
Newbie
*
Posts: 16


View Profile Email
« Reply #5 on: June 16, 2015, 07:13:58 PM »

tks, again!
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!