Multi-column layout for certain datatable

Multi-column layout for certain datatable

VyacheslavVyacheslav Posts: 70Questions: 27Answers: 0

How can I use Multi-column layout for certain datatable only, i.e. not for all datatables in project ?

This question has an accepted answers - jump to answer

Answers

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    How can I use Multi-column layout for certain datatable only

    This doesn't make any sense... Unless you mean just a single column. In that case, just make a table with a single column..

  • VyacheslavVyacheslav Posts: 70Questions: 27Answers: 0

    I meant Multi-column layout in Editor.
    The most datatables look better with Single-column layout but I have a couple of heavy datatables for which is better to use Two columns-mode (in Editor).

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin
    Answer ✓

    Thanks for your question (referring to this example).

    To have that layout for only some instances, you'd need to use a CSS selector and probably add and remove a class from the div.DTE element when the Editor is opened and closed. For example you might use:

    editor.on( 'open', function () {
      $('div.DTE').addClass('multi-column');
    } );
    
    editor.on( 'close', function () {
      $('div.DTE').removeClass('multi-column');
    } );
    

    Add that only for the Editor instances you want to be multi-column and of course update the CSS selectors for the multi-column CSS to match.

    Allan

  • VyacheslavVyacheslav Posts: 70Questions: 27Answers: 0

    Exactly! Shame on me I did not think about that way (((

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    Oh I apologize, I should have looked at the category

This discussion has been closed.