How to Applying Background and Foreground Fills HTML

Here, you will learn how to apply a different color background to a heading row to make it exceptional or change the color of every other line in a table to help users to track a line across the table.

To apply a background color to a table, use the background-color.

Like :- <tr style=”background-color: pink”>

You can make a picture as a background in a table for that apply background-image attribute to any portion of a table.

Like :- <table style=”background-image: url(images/educational package.jpg)>

You can also set the color of any table element.

Like :- <table style=”color: blue”>

Here is an example where we illustrate the table style color to be orange.

Code

Output