In the text block editor on your website you can add a table to your page however the table doesn't have table borders or alternating colours by default. Sometimes you may want to add borders or alternating colours to your table - this can be achieved by adding some code to your site that will add borders and alternating colours to all of your tables on your site.
How to add Borders:
-
Go to your website dashboard and click on the Get Found SEO on the left-hand side.
- Once in the Get Found SEO section scroll down to the Additional Tracking section
-
Paste the code below into the “Custom <body> tracking code” textbox and click save.
Note this will add black borders to all of your tables on your site.
For tables throughout your website:
<style>
For tables in your shop:
#main_body .text_block .text_block_text table td{
border: 0.0625rem solid #000;
padding: 0.25rem;
}
</style>
<style>
#product-description table td{
border: 0.0625rem solid #000;
padding: 0.25rem;
}
</style> -
If you would like to change the colour of the border, simply change the “#000” in the code to the hex code that you want.
For example, if you wanted the border colour to be red the hex code would be: #ff0000.
How to add alternating colours:
-
Go to your website dashboard and click on the Get Found SEO on the left-hand side.
- Once in the Get Found SEO section scroll down to the Additional Tracking section
-
Paste the code below into the “Custom <body> tracking code” textbox and click save.
Note this will add alternating colours for all your tables on your website.
You are able to change the colour of the background colour just by substituting the #f1f1f2 with another hex code colour.<style>
#main_body .text_block .text_block_text table tr:nth-of-type(even) {
background-color:#f1f1f2;
}
#main_body .text_block .text_block_text table td{
padding: 0.5rem;
}
#main_body .text_block .text_block_text table th{
padding: 0.5rem;
}
</style>
Please note that these changes will only be visible when you are logged out of your dashboard.