Responsive Table With Ellipsis

Responsive Table With Ellipsis

DalderDalder Posts: 30Questions: 12Answers: 1


Apologies, another question!

I'd like to use the ellipsis plugin to help limit the number of columns I have to collapse using the responsive extension.

However, if the ellipsis'd column does get collapsed, I would like the full, unshortened version of the data to be visible in the that reflowed data.

Here is an example of what happens currently:

Is this easily achievable?

Thanks in advance,


This question has an accepted answers - jump to answer


  • rf1234rf1234 Posts: 2,851Questions: 85Answers: 409

    You can check whether a column is hidden by the responsive extension:

    Something like this could work:

        .on( 'responsive-resize', function () {
            var colsArray = table.columns().responsiveHidden().toArray();
            var hiddenColsArray = [];
            $.each(colsArray, function(key, value) {
                if ( ! value ) {

    This would give you an array of column indexes which are hidden by the responsive extension. I guess you'll figure out the rest :smile:

  • DalderDalder Posts: 30Questions: 12Answers: 1

    Thanks for the response, although I'm not entirely sure how that relates to my issue?

    In the meantime, I've come up with a workaround, although it's not particularly clever.

    All I've done is edit the return of the ellipsis renderer to do this:

    return '<span class="ellipsis-shortened" title="'+esc(d)+'">'+shortened+'&#8230;</span><span class="ellipsis-full">'+esc(d)+'</span>';

    and have added the following CSS:

    span.ellipsis-full {
        display: none;
    span.dtr-data > span.ellipsis-shortened {
        display: none;
    span.dtr-data > span.ellipsis-full {
        display: inline;

    This does the trick, but it would be preferable to have a JS only fix so simplicity's sake.

    @Allan - sorry to tag you directly, is this something you've been asked about before?

  • colincolin Posts: 15,220Questions: 1Answers: 2,592
    Answer ✓

    This does the trick here - it's a tweak from this thread that I did this morning. It's using a custom renderer that allows you to define what tables goes into the child rows. Here, I'm using the raw data again, rather than the rendered data,


Sign In or Register to comment.