Understanding HTML tables Part 5

Borders width cellpadding background images rowspan
alignment height cellspacing background colour colspan

Table Attributes

continued...

Background Images

You can set your whole table to have a background image, or just the individual data cell. If you put the background image in the data cell, then you could set each cell to have a different image.


using table background images







first cell

second cell
putting the background in the entire table if you have multiple cells, the background still covers them all.




using td background images







first cell

second cell
putting the background into a data cell if you have multiple cells, the rest aren't affected by the background



using multiple td background images







first cell

second cell
putting the background into a data cell you can set different backgrounds in each data cell



mixing table and td background images








first cell

second cell

third cell
this data cell has no background set so it has the table background showing through this data cell has a background specified this data cell has no background set so it has the table background showing through


Background Colour

using table background colours







first cell

second cell
setting the background colour in the entire table if you have multiple cells, the background colour still covers them all.



using td background colours







first cell

second cell
putting the background colour into a data cell if you have multiple cells, the rest aren't affected by the background colour of another cell



using multiple td background colours







first cell

second cell
putting the background colour into a data cell you can set different background colours in each data cell



mixing table background colours and td background colours








first cell

second cell

third cell
this data cell has no background colour set so it has the table background colour showing through this data cell has a background colour specified this data cell has no background colour set so it has the table background colour showing through



mixing background colours and background images








first cell

second cell

third cell
this data cell has no background colour set so it has the table background colour showing through this data cell has a background specified this data cell has a background colour set