How can I apply styling to the datatable's search input & la


Topic: How can I apply styling to the datatable's search input & label

shamca asked 6 years ago

Hi - I have the datatables working well, but can't figure out how to apply styles to the search input & it's label. I've tried to attach a capture of the component I'm referring to, but your 'insert image' doesn't allow a file upload.


shamca answered 6 years ago

I figured it out. Line 14422 of datatables.js has a property "sFilter" which holds the strings to write out. Added 'text-right' and it's ok for now.

"sFilter": "dataTables_filter text-right",

Marta Szymanska staff pro premium answered 6 years ago

Hi,

would you reproduce your problem in our snippets here: https://mdbootstrap.com/snippets/? I'll try to help you.

Best,

Marta


shamca answered 6 years ago

Hey Marta - thanks for answering. Not sure that I can attach a snippet - it's a rails application and the search component I want to style is enclosed by a <div class="row"> that is dynamically rendered by the datatables code.

BTW - how is one to insert an image in this response? The dialog that comes up simply says 'source' ...?

Thanks, 

Shaun


shamca answered 6 years ago

Hey Marta - thanks for answering. Not sure that I can attach a snippet - it's a rails application and the search component I want to style is enclosed by a <div class="row"> that is dynamically rendered by the datatables code.

BTW - how is one to insert an image in this response? The dialog that comes up simply says 'source' ...?

Thanks, 

Shaun


shamca answered 6 years ago

Capture

Here's a capture - the auto generated div & class are highlighted on the right. Not sure where in config to add style information.

 


shamca answered 6 years ago

I figured it out. Line 14422 of datatables.js has a property "sFilter" which holds the strings to write out. Added 'text-right' and it's ok for now.

"sFilter": "dataTables_filter text-right",

Marta Szymanska staff pro premium answered 6 years ago

Hi,

do you still need my help?

Best,

Marta


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: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.5.15
  • Device: Desktop
  • Browser: Chrom
  • OS: MacOS
  • Provided sample code: No
  • Provided link: No