I'm modifying a theme I found for Hugo and I wondered how I can add a css class to the tables in the HTML code generated.
I want to use a css framework and I would like if the tables haveclass="u-full-width"
, I know I can edit the css codes but I think there must be a clever way.
Somthing that automatically add the class attributes to every tables in the HTML generated code.
You can do that with javascript you can simply use
var tables = document.getElementsByTagName("table")
as your selector.Then add the class using
for
here is the code
Yes you can