HTML atributo da tabela bgcolor
Exemplos
tabela HTML com cor de fundo:
<table border="1" bgcolor="#00FF00">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
tente »
Suporte a navegadores
Todos os principais navegadores suportam o atributo bgcolor.
Definição e Uso
O HTML5 não suporta o <table> atributo bgcolor. Use CSS em vez disso.
Em HTML 4.01, <table> o bgcolor atributo obsoleto .
bgcolor atributo especifica a cor da tabela de fundo.
Notas de compatibilidade
Em HTML 4.01, <table> o bgcolor atributo obsoleto, utilize o CSS em seu lugar.
sintaxe CSS: <table style = "background-color: red">
CSS Exemplo: cor de fundo da tabela
Em nosso tutorial CSS você pode encontrar mais informações sobre os atributos background-color detalhes.
gramática
<table bgcolor="color_name|hex_number|rgb_number">
Valor de propriedade
值 | 描述 |
---|---|
color_name | 规定颜色值为颜色名称的背景颜色(比如 "red")。 |
hex_number | 规定颜色值为十六进制值的背景颜色(比如 "#ff0000")。 |
rgb_number | 规定颜色值为 rgb 代码的背景颜色(比如 "rgb(255,0,0)")。 |
tag HTML <table>