HTML Table Color
This page contains HTML table color code. In other words, HTML codes for specifying or changing the color of your tables within your web page.
HTML table color is specified using Cascading Style Sheets (CSS).
Change Table Background Color
To change the background color of a table, use the CSS background-color
property.
The following example sets the background color for the whole table. You can also set the background color of a table row and an individual table cell.
To do this, see HTML Table Background Color.
Change Color of Text in Table
To change the color of the text inside the table, you need to use the CSS color
property. As with the background-color
property, you can apply this against the whole table, a single row, or a single cell.
Table Border Color
To change the color of the border, you need to use one of the CSS border properties. In most cases, the best one to use is the border
property. You need to provide this property with 3 values: a value for the width of the border, a value for the style of border (solid, dotted, etc), and another for the color of the border.
You'll notice that the following example only has a border around the outside of the table. This is working correctly - you can apply the border
property against the whole table, or against single cells.
There are a few considerations to take into account when doing this. See HTML table borders for a more detailed explanation of table borders.
About HTML Colors
The examples on this page use basic color names to define the color to be used. HTML/CSS provides several different means of defining color. Here are some useful links to help you pick a color for your table:
HTML Reference
-
HTML Tutorial
Free HTML tutorial that explains how to code in HTML.
This tutorial explains what HTML elements and attributes are, and how to use them.
I explain the basics, such as what you need in order to write HTML and how to create your first web page.
I then cover other HTML topics including tables, adding color, images, forms, image maps, iframes, meta tags, and more.
I also explain the difference between HTML and CSS (and when to use each one).
Go to HTML Tutorial -
HTML Tags
Full list of all HTML elements.
This is an alphabetical list of HTML elements, linking to a full page of details for each element.
All elements are based on the official HTML5 specification, and include usage notes, full attribute list, as well as links to the various specifications for each element (i.e. HTML4 spec, HTML5 spec, WHATWG spec).
Go to HTML Tags -
CSS Properties
Full list of CSS properties.
Alphabetical list of CSS properties as per the W3C specifications.
CSS stands for Cascading Style Sheets. CSS is the standard way to style web pages.
You can use CSS to set the style for a whole website in one place. CSS allows you to set colors, fonts, widths, heights, margins, padding, and much more.
Go to CSS Properties