datatable with ellipsis
datatable with ellipsis
Hi,
Since I saw some people look to an answer regarding how to integrate text-overflow:ellipsis; into the datatable cell ,I'll show how I did it.
The trick is to wrap the cell text with a div .
css:
[code]
div.test
{
white-space:nowrap;
//width:12em;
max-width:12em;
overflow:hidden;
}
[/code]
javascript:
[code]
oTable = $('#AttributesList-table').dataTable({
"aoColumnDefs": [
{
"aTargets": [ '_all' ],
"mRender": function ( data, type, full ) {
if(data!=null)
{
return ''+data+'';
}
else
{
return '';
}
}
}
]
});
[/code]
Since I saw some people look to an answer regarding how to integrate text-overflow:ellipsis; into the datatable cell ,I'll show how I did it.
The trick is to wrap the cell text with a div .
css:
[code]
div.test
{
white-space:nowrap;
//width:12em;
max-width:12em;
overflow:hidden;
}
[/code]
javascript:
[code]
oTable = $('#AttributesList-table').dataTable({
"aoColumnDefs": [
{
"aTargets": [ '_all' ],
"mRender": function ( data, type, full ) {
if(data!=null)
{
return ''+data+'';
}
else
{
return '';
}
}
}
]
});
[/code]
This discussion has been closed.
Replies
Allan