Cannot change td/tr alignment in DataviewJS table

I am trying to right justify my table rows. The tables are generated with dataviewjs. I added a class with dv.container and I know I’m targeting the correct elements because I can change their color for example. They just don’t respect the text-align: right. I can see the property crossed out in Dev tools.

Any thoughts?

Most likely you don’t have high enough specificity in your CSS rule. So check the dev tools for the computed type, and make sure your rule has a hogher specificity.

That is add a few more generic classes in front of your current rule. You might also need to change which element you target, but it’s hard to tell when we don’t know your current rule attempt.

1 Like

Thanks for the reply. I did track it down in a theme. (BTW I learned that if you change styles in a plugin you have to reload the plugin to see the change.)

But that begs the question as to why it takes precedence. I applied the class with dv.container in the script itself, which I would have expected to be as specific as possible, but apparently not. Is this a general rule that themes’ styles over-ride all other css?

This is more than an inconvenience since it means changing it every time the theme gets updated.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.