Responsive Table Shows the Hidden Columns

Responsive Table Shows the Hidden Columns

ViniciusMachadoViniciusMachado Posts: 10Questions: 1Answers: 0

How to hide columns with the responsive table? And how to hide columns from printing? I've serached a lot but just found tips about older versions like Tabletools

Regards

Replies

  • madvoramadvora Posts: 11Questions: 4Answers: 0

    You have to have to set when you want each column visible, as in visible on what type of device.
    See here. https://datatables.net/extensions/responsive/classes

    "columnDefs": [
        //Responsive classes
        { className: 'never', targets: 0 }, //Hide on all devices
        { className: 'all', targets: 1 },       //Show on all devices
        { className: 'never', targets: 2 },
        { className: 'all', targets: 3 },
        { className: 'all', targets: 4 },
        { className: 'all', targets: 5 },
        { className: 'not-mobile', targets: 6 },    //Hide on mobile        
    ],
    
  • ViniciusMachadoViniciusMachado Posts: 10Questions: 1Answers: 0

    Thanks madvora tha works! But do you know how to enable printing or exporting this columns?

  • ViniciusMachadoViniciusMachado Posts: 10Questions: 1Answers: 0

    Hi @madvora I am not finding how to mark your response as answered my question.

This discussion has been closed.