Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82468

Clickable truncate JS

$
0
0

For whom it may interest
If you are having the same issue as me with a lot of data for a column, that you need to check some times, but not want to show at all times, this code might help you. Truncate is here clickable - on/off.

$(".truncate").on("click", function() {
                var index = $(this).index() + 1;
                $('table tr td:nth-child(' + index  + ')').toggleClass("truncate");
            });

code for CSS:

.truncate {
    max-width:80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    }

Best regards
Claus


Viewing all articles
Browse latest Browse all 82468

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>