DataTables presenting with a card view - Page 2

DataTables presenting with a card view

2»

Replies

  • hm123hm123 Posts: 67Questions: 17Answers: 1

    @gyrocode yes that css rule does work, thank you.

    But only with exportOptions { columns: [':visible'], rows: [':visible']} in the code instead of exportOptions: { rows: [':visible']}, which you seem to have given in the example, as it still copies hidden columns to the clipboard.

    I've also implemented a rough fix for the hidden thead that takes up space

    example: https://jsfiddle.net/suwznyaf/

  • bfarkasbfarkas Posts: 18Questions: 5Answers: 0

    This is awesome, and so simple in the scheme of things. Is there an easy way to control which view is shown on page load? i.e. have the table load in card view?

  • kthorngrenkthorngren Posts: 9,705Questions: 25Answers: 2,234

    Looks like you will need to add the calls cards to the table tag. The rowCallback converts to card mode if the table has the class cards.

    Kevin

  • mr.eddymamr.eddyma Posts: 1Questions: 0Answers: 0

    The example is very useful! How can make the card view in center position? Besides, how can set the card view as default mode when the page is loaded? Thanks!

  • kthorngrenkthorngren Posts: 9,705Questions: 25Answers: 2,234

    How can make the card view in center position?

    Remove the float: left from this CSS:

    .cards tbody tr {
       float: left;
       ....
    

    how can set the card view as default mode when the page is loaded?

    Add the class cards to the table tag.

    Kevin

Sign In or Register to comment.