html5的表格边框怎么表示实线

html-css016

html5的表格边框怎么表示实线,第1张

<style type="text/css">

<!--

.tableborder {

border-top-width: 1px

border-right-width: 1px

border-bottom-width: 1px

border-left-width: 1px

/*以上分别设置的是表格边框中上右下左的边框宽度*/

border-top-style: solid

border-right-style: solid

border-bottom-style: solid

border-left-style: solid

/*设置边框的表现样式,solid为实线*/

border-top-color: #0000FF

border-right-color: #0000FF

border-bottom-color: #0000FF

border-left-color: #0000FF

/*设置边框的颜色*/

}

-->

</style>

<table width="300" height="100" border="0" align="center" cellpadding="0" cellspacing="0" class="tableborder">

<tr>

<td>class="tableborder"是对样式的调用,写在table标签内</td>

<td></td>

</tr>

</table>

默认就是实线了,但是可以利用css修改其样式,如:

border:1px solid #a0df61

这样就设置了边框为1像素,实线,颜色为#a0df61

这个可以使用css来控制边框根据不同的需求,您可以对表格和单元格应用不同的边框。您可以定义整个表格的边框也可以对单独的单元格分别进行定义。CSS的边框属性可以指定边框的大小以及颜色和类型。以下的代码定义了宽度为5个像素的黑色实线边框: TABLE { 5px solid black} 除此以外,您还可以使用相同的语法为表格中单独的单元格分别指定边框属性。您可以使用以下的属性值来定义边框类型: l none: 指定表格没有边框,所以边框宽度为0。l dotted: 由点线组成的表格边框。l dashed: 由虚线组成的表格边框。l solid: 由实线组成的表格边框。l Double: 由双实线组成的表格边框。l Groove: 槽线效果边框。l ridge: 脊线效果边框,和槽线效果相反。l inset: 内凹效果边框。l outset: 外凸效果边框,和内凹效果相反。每个边框类型都可以指定一种颜色,边框是绘制在背景颜色上的,列表A使用边框属性来样式化整个表格以及锚标记和单独的单元格。 <html><head><title>HTML Table</title></head><style type="text/css">TABLE { background: blueborder-collapse: separateborder-spacing: 10ptborder: 5px solid red}TD, TH { background: whiteborder: inset 5pthorizontal-align: right}CAPTION { border: ridge 5pt blue}</style><body><table summary="TechRepublic.com - Tables and CSS"><caption>First Quarter Sales</caption><thead><tr><thabbr="salesperson" scope="col">Person</th><thabbr="sales" scope="col">Sales</th></tr></thead><tbody><tr><td>Mr. Smith</td><td>600.00</td></tr><tr><td>Mr. Jones</td><td>0000.00</td></tr><tr><td>Ms. Williams</td><td>0000.00</td></tr></tbody><tfoot><tr><td colspan="2">Let's sale, sale, sale!</td></tr></tfoot></table></body></html>