CSS - Tables and Fonts

CSS - Tables and Fonts

by Tim F -
Number of replies: 3

Hello I have 2 questions related to custom CSS

I am trying to set a table style :
-black background 10px all around the table that then I can use throughout the site and adjust it as needed without simply having teachers copy and paste the HTML into each location.  What is best practice for this? 


Now regarding the text inside of the tables - we want to use one of our custom CSS styles .h4 for example but instead of it being black color we want the .H4 in this table to be white or orange - best to just change the color or create a new style and then use that style in this boxes?  

Average of ratings: -
In reply to Tim F

Re: CSS - Tables and Fonts

by Hugo Ribeiro -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
One approach could be using filters. However you would have to create your own (and that depends on your resources) https://docs.moodle.org/dev/Filters
In reply to Hugo Ribeiro

Re: CSS - Tables and Fonts

by Tim F -
What about just this point related to the style of the table?
In reply to Tim F

Re: CSS - Tables and Fonts

by Jon Bolton -
Picture of Particularly helpful Moodlers Picture of Testers
This will help with your table definition - https://moodle.org/plugins/atto_styles

For the styles, give the table a class name and then you can target everything in the table separately to the rest of your content.

So table.classname h4 {...} will only affect the h4 in your table, not all of the h4 on your site.