Pages

Friday, November 1, 2013

How to Change the Color of a Table Cell

How to Change the Color of a Table Cell

HTML tables lay out website elements on a web page. Tables are comprised of rows and columns and each field represents one part of the table. These fields provide properties for HTML programmers to set the font, border and background color. The table cell's background color shades the cell with a hexadecimal color value. The table cell is represented using the "" HTML tag and the color is changed using the "bgcolor" table cell property.

Instructions

    1

    Open your HTML file and scroll down to the section with your table. A table is created using the "

    " and "
    " tags. Within these two tags are your table rows and cells.

    2

    Insert a new table cell. You can insert a new table cell or use an existing cell. Table cells are created using the "" and "" tags. The following gives you an example of a table with one row and two table cells:






    First Cell Second Cell

    3

    Add a background color to your table cells. The "bgcolor" property is used within the "" tag. In the following code, the table cells' color is changed to white:






    First Cell Second Cell

    The hexadecimal value for white is "ffffff." There are more than 16 million color hexadecimal values (see Resources) you can use with your web pages.

0 comments:

Post a Comment