datatable with ellipsis

datatable with ellipsis

NextarOneNextarOne Posts: 3Questions: 0Answers: 0
edited March 2014 in Plug-ins
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]

Replies

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    Very nice - thanks for sharing this with us!

    Allan
This discussion has been closed.