Topic: Is there documentation for formatting a datatable?

DashMarketingGroup priority asked 11 months ago


I have looked through all of the documentation for examples and instructions for styling a datatable that I am loading asynchronously, and I have not been successful. What I want to know is, how can we style the cells of a datatable to be able to left-justify, right-justify, or center content? Can we format content (such as currency amounts) or use checkboxes to display boolean values instead of the default, which is to show true or false?

This component would be far more useful and valuable if we could do these things, or if it is already possible, to have access to the necessary documentation on how to achieve it. Thank you.


Kamila Pieńkowska staff answered 11 months ago


In this section you can see how to apply custom formatting to every cel: https://mdbootstrap.com/docs/standard/data/datatables/#section-cell-format

Cells can contain HTML to display checkboxes, buttons, popovers and so on. It is best to wrap this kind of content in other tags f.e div.

You can change alignment by using custom CSS or div with alignment classes. You can use this method to utilize all Content & Styles features from our docs.



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

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 7.0.0
  • Device: desktop
  • Browser: chrome
  • OS: win 11
  • Provided sample code: No
  • Provided link: No