responsive plugin troubles

responsive plugin troubles

INTONEINTONE Posts: 153Questions: 58Answers: 6
edited August 2015 in DataTables 1.10

when the cell content is very long and the datatable is collapsed it looks like this:
http://www.basisystem.com/images/Screenshot.png

Is there a way to fix this?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    Add a columns.defaultContent option for the first column which has   for the first column. Or simply set a min-height in your CSS for the rows.

    Allan

  • INTONEINTONE Posts: 153Questions: 58Answers: 6

    I tried what you said using:

      /*fix issue with responsive datatables when first column is too long*/
     @media only screen 
     and (min-width : 300px) 
     and (max-width : 400px) {
    
     table.dataTable tr td:nth-child(1) {
        height: 30px !important;
        min-height: 30px !important;
       }
     }
    

    It turn out that the td did get bigger but it still had no data. After further investigations I realised that the image is depicting the actual first td and the second td is removed automatically , I am assuming by the responsive css. How can I get the second td to not be removed when the datatable is collapsed and the width of the table is less than 400px?

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Answer ✓

    If you don't want columns to be removed by Responsive, you can use special classes on the columns to indicate this. This is covered in the documentation here.

    Allan

  • INTONEINTONE Posts: 153Questions: 58Answers: 6
    edited August 2015

    Thank you very much. Did I remind you how awesome editor and datatables are? They are really awesome!

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    Thanks :-)

This discussion has been closed.