≡

How to alter style of layout row?

How to alter style of layout row?

craighcraigh Posts: 29Questions: 11Answers: 1

I'd like to add a bootstrap class px-3 to a layout row but cannot figure out how to do so. My current config is something like this - I'd like to add the class to top1 or even top1Start and top1End

        config: {
            layout: {
                top1Start: {
                    buttons: {
                        buttons: ['columnRestore'],
                    },
                },
                top1End: {
                    buttons: [
                        'exportCsvButton',
                        'printButton',
                    ],
                },
            },
            colReorder: true,
            stateSave: true,
        },

To clarify - I don't want to globally change anything, only this table in this spot.

This question has an accepted answers - jump to answer

Answers

  • craighcraigh Posts: 29Questions: 11Answers: 1

    hmmm. I found this (https://datatables.net/examples/core/layout/ids-and-classes.html) and from that derived that I must have a features object in the config. If that is present I can also set a rowClass... hmmm.

  • allanallan Posts: 66,016Questions: 1Answers: 10,994 Site admin
    Answer ✓

    This is as close as you can get at the moment: https://live.datatables.net/wiwugife/1/edit .

    You can't specify a class on a Bootstrap row element individually. You could add it to all rows using DataTable.ext.classes.layout.row = '...'; while the className or rowClass properties will apply to the "cells" in the layout grid.

    Does that give you the layout you want?

    Allan

Sign In or Register to comment.