Skip to content

How to make a responsive datatable? #2652

Closed Answered by cguerrero1205
cguerrero1205 asked this question in PrimeFaces
Discussion options

You must be logged in to vote

Hi, @melloware

Thanks to your recommendation, I found the solution to my problem. I modified the Script you shared with me, I added a CSS for what I wanted, additionally I modified the so that the titles are in bold and have a fixed size, so the table looks a little more organized.

At the end the script looked like this:

if (PrimeFaces.widget.DataTable) {
    PrimeFaces.widget.DataTable.prototype.initReflow = function() {
        var headerColumns = this.thead.find('> tr > th');

        for (var i = 0; i < headerColumns.length; i++) {
            var headerColumn = headerColumns.eq(i),
                reflowHeaderText = headerColumn.find('.ui-reflow-headertext:first').text(),

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@melloware
Comment options

@cguerrero1205
Comment options

@melloware
Comment options

@cguerrero1205
Comment options

Answer selected by cguerrero1205
@melloware
Comment options

@cguerrero1205
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
2 participants