Change vertical listing of columns in colvis collection to horizontal

Change vertical listing of columns in colvis collection to horizontal

jbholajbhola Posts: 1Questions: 1Answers: 0

Hi,
I am following this example to add column visibility feature in my datatable. i want to change the vertical listing of column names in colvis button to horizontal. How can that be done?

Thanks

Answers

  • colincolin Posts: 15,174Questions: 1Answers: 2,589

    Hi jbhola,

    This page shows an example of two-column layout.

    The default CSS goes up to four-column,

    div.dt-button-collection.four-column {
      width: 600px;
      padding-bottom: 1px;
      -webkit-column-count: 4;
      -moz-column-count: 4;
      -ms-column-count: 4;
      -o-column-count: 4;
      column-count: 4;
    }
    
    

    You could modify this with your own that would then take it to six-column, which would provide the layout you want. See this example, this is a rough horizontal listing, but it shows what can be done.

    Cheers,

    Colin

This discussion has been closed.