Styling the "Search:" text

Styling the "Search:" text

sjur@bytetec.nosjur@bytetec.no Posts: 3Questions: 0Answers: 0
edited March 2011 in General
Hello,
It would be great if the datatables plugin rendered a span element around the "Search:" text, so that it can be styled individually.

Thanks

Replies

  • FLOKERFLOKER Posts: 3Questions: 0Answers: 0
    Hey, I'm also new to this but you could try it like this:

    Open your jquery.dataTables.js and go to line 966 or just search for "Search:"
    You'll find this line:

    [code] "sSearch": "Search:",[/code]

    Now you can wrap your own span around it:

    [code] "sSearch": "Search:",[/code]

    Hope it works ;)
  • sjur@bytetec.nosjur@bytetec.no Posts: 3Questions: 0Answers: 0
    FLOKER: Thanks for your reply. We have already fixed the issue in our local version of dataTables, but it would be great if it was included in the official version as well, so that we don't have to merge changes when a new version is released. :)
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Is there a reason you can't just use the div tag already around the search field: .dataTables_filter {...}? If the text input inherits a property then it might need to be set back, but that seems okay to me.

    Allan
  • sjur@bytetec.nosjur@bytetec.no Posts: 3Questions: 0Answers: 0
    Thanks allan. I was able to solve the issue using your approach. The reason for my request was that I needed to move the search text a bit down. Using your approach I add a padding to the .dataTables_filter class, and then add absolute positioning to the input field to prevent it from getting the same padding.

    Sjur
This discussion has been closed.