MDB Datatables How to add class to thead, tbody, tr, or td


Topic: MDB Datatables How to add class to thead, tbody, tr, or td

IT_Santini pro premium priority asked 3 years ago

Expected behavior Can add class to individual tr or td, so it can for example align text or items, For example: columns: [ { label: 'Name', field: 'name' }, { label: 'Position', field: 'position' }, { label: 'Office', field: 'office', className: 'text-center' }, { label: 'Salary', field: 'salary', className: 'text-right' }, { label: 'Contact', field: 'contact', sort: false, className: 'justify-content-center' }, ] Actual behavior I don't know how to achieve this

Resources (screenshots, code snippets etc.) https://mdbootstrap.com/snippets/standard/it_santini/3461563


launchbrigade pro premium priority answered 3 years ago

Just wanted to chime in and say that this should be considered as a feature. With all the devices available for people, we need smooth ways of handling breakpoints and using inline styles really sucks for this.


Michał Duszak staff commented 3 years ago

Hello, we will consider adding this feature in the future.


Michał Duszak staff answered 3 years ago

Rendering datatable with custom classess for cells/rows/columns is not handled. Similiar options which you can use are listed below: https://mdbootstrap.com/docs/standard/data/datatables/#section-action-btns https://mdbootstrap.com/docs/standard/data/datatables/#section-cell-format


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.10.0
  • Device: Laptop
  • Browser: Chrome
  • OS: WIndows 10
  • Provided sample code: No
  • Provided link: Yes