[index.js]
var grid = new ej.grids.Grid({
dataSource: data,
gridLines: 'Both',
columns: [
{ field: 'CustomerName', headerText: 'Customer Name', width: 150, textAlign: 'Left', customAttributes: { 'class': 'customcss' } },
...
]
});
------------------------------------------------------------------------------------------------
[index.html]
<style>
.e-grid .e-rowcell.customcss {
padding-top: 0px !important;
}
.e-grid .e-headercell.customcss {
padding-bottom: 20px !important;
}
</style>
|
[index.js]
var grid = new ej.grids.Grid({
….
columns: [
{ field: 'CustomerName', headerText: 'Customer Name', headerTextAlign: "Center", width: 150 }
...
]
});
|
var grid = new ej.grids.Grid({
dataSource: data,
allowPaging: true,
columns: [
{ field: 'OrderID', headerText: 'Order ID', width: 120, customAttributes: {class: 'orientationcss'} },
{ field: 'CustomerName', headerText: 'Customer Name', width: 150 },
]
});
grid.appendTo('#Grid');
<style>
.orientationcss .e-headercelldiv {
padding-top: 10px;
text-align: right;
}
</style> |
[index.js]
var grid = new ej.grids.Grid({
dataSource: data,
allowPaging: true,
columns: [
{ field: 'OrderID', headerText: 'Order ID', width: 120, customAttributes: { class: ['orientationcss', 'customcss'] } },
{ field: 'CustomerName', headerText: 'Customer Name', width: 150 },
]
});
---------------------------------------------------------------------------------------------------------------
[index.html]
<style>
.orientationcss .e-headercelldiv {
padding-bottom: 20px;
text-align: left;
}
.e-grid .e-rowcell.customcss {
padding-top: 10px;
padding-bottom: 0px;
text-align: right;
}
</style>
|