Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: How to add custom class for datatable?

IT_Santini priority asked 2 years ago


Expected behavior Can add custom class to a datatable table tag, either manually from html or from options javascript api attributes

Actual behavior Cannot add custom class to datatable table tag

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


Grzegorz Bujański staff answered 2 years ago


At the moment it is not possible. You can add this class with js code:

document.addEventListener('DOMcontentLoaded', () => {
  document.querySelector('datatable table').classList.add('custom-class');
})


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 3.10.2
  • Device: Laptop
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: Yes