html颜色代码表标签(html表格颜色代码怎么写)

html表格颜色代码怎么写

下面的例子指定边框的颜色,和th元素的文本和背景颜色:
例《html》
《head》《style》
table, td, th
{
border:1px solid green;
}
th
{
background-color:green;
color:white;
}
《/style》《/head》《body》
《table》
《tr》
《th》Firstname《/th》
《th》Lastname《/th》
《th》Savings《/th》
《/tr》
《tr》
《td》Peter《/td》
《td》Griffin《/td》
《td》$100《/td》
《/tr》《/table》《/body》《/html》

HTML线条颜色代码

只需要给table添加bordercolor属性就可以给表格设置边框颜色了。

例如:

《tableborder=“5“align=“center“height=“100“width=“400“bordercolor=“#CC0000“》

《tr》

《td》1《/td》

《td》2《/td》

《/tr》

《tr》

《td》1《/td》

《td》2《/td》

《/tr》

《/table》

扩展资料

《table》 标签定义 HTML 表格。

简单的 HTML 表格由 table 元素以及一个或多个 tr、th 或 td 元素组成。

tr 元素定义表格行,th 元素定义表头,td 元素定义表格单元。

更复杂的 HTML 表格也可能包括 caption、col、colgroup、thead、tfoot 以及 tbody 元素。

在 HTML 4.01 中,table 元素的 “align“ 和 “bgcolor“ 属性是不被赞成使用的。

在 XHTML 1.0 Strict DTD,table 元素的 “align“ 和 “bgcolor“ 属性是不被支持的。

《table》 标签支持 HTML 中的全局属性。

《table》 标签支持 HTML 中的事件属性。