CSS styling not applied

CSS styling not applied

gaialabsgaialabs Posts: 2Questions: 0Answers: 0

Hello,

I'm using dataTables for a while and it always work like a charm. Excepted with this case.

Javascript is working as I can order columns, search, hide columns, etc. But the styling isn't applied despite the CSS is correctly enqueued in WP and appears in the source code.

I can't see any error message in the javascript console.

The test case URL is here : https://staging.aspce.ch/pce/

Thank you very much for any help :-)

Replies

  • kthorngrenkthorngren Posts: 21,336Questions: 26Answers: 4,951

    I have not used the media attribute of the link tag so my observation might be wrong but you have this:

    <link rel='stylesheet' id='dataTables-css-css' href='https://cdn.datatables.net/1.13.5/css/jquery.dataTables.css?ver=6.2.2' type='text/css' media='1' />
    

    But you have media='all' for everything else. 'm not sure what media='1' refers to. Maybe you need to remove or change it to media='all'.

    Kevin

  • gaialabsgaialabs Posts: 2Questions: 0Answers: 0

    Hi Kevin,

    Thank you very much, that was the issue indeed. Actually I used wp_register_style with last argument set to true (-> 1), using the same arguments than for wp_register_script. Removed that and it worked :-)

    Alexis

Sign In or Register to comment.