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: Formatting the header of an mdbdatatable

DashMarketingGroup priority asked 6 months ago


I am using a datatable, with the code below:

    <div class="datatable mb-5" id="dtProducts" data-mdb-striped="true" data-mdb-hover="true" data-mdb-loading="true" 
        data-mdb-color="light-blue" data-mdb-loader-class="bg-success" data-mdb-border-color="dark" data-mdb-fixed-header="true" 
        data-mdb-max-width="100%">
    </div>

I cannot find anything in the documentation on how to format the column headers. I want to use a larger font, and both a foreground and background color. I found code for formatting cells and rows, but nothing on the column headers.

Thank you!


Kamila Pieńkowska staff answered 6 months ago


To format headers you can either use CSS (not inline) that targets those parts or nest div tag in the cell that you want to format. To ensure a uniform table appearance, we need to strip inline styles during rendering but if you nest div in the cell the styles and classes of that div will be applied.


DashMarketingGroup priority answered 6 months ago


Thank you. That worked.



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.3.1
  • Device: Laptop
  • Browser: Chrome
  • OS: Win11
  • Provided sample code: No
  • Provided link: No