<style type="text/css">
table.gridtable {}{
font-family: verdana,arial,sans-serif
font-size:11px
color:#333333
border-width: 1px
border-color: #666666
border-collapse: collapse
}
table.gridtable th {}{
border-width: 1px
padding: 8px
border-style: solid
border-color: #666666
background-color: #dedede
}
table.gridtable td {}{
border-width: 1px
padding: 8px
border-style: solid
border-color: #666666
background-color: #ffffff
}
</style>
<!-- Table goes in the document BODY -->
<table class="gridtable">
<tr>
<th>Info Header 1</th><th>Info Header 2</th><th>Info Header 3</th>
</tr>
<tr>
<td>Text 1A</td><td>Text 1B</td><td>Text 1C</td>
</tr>
<tr>
<td>Text 2A</td><td>Text 2B</td><td>Text 2C</td>
</tr>
</table>
CSS(层叠样式表)级联样式表是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
您好!以下是最典型的细线表格,具备最基本的设置。供参考:
<!doctype html><html>
<head>
<meta charset="utf-8">
<title>表格CSS设置</title>
<style>
#tb1 {
border-collapse: collapse /* 折叠边框产生细线表格*/
border: 2px solid black /* 外框粗线、内部细线表格,表格线为黑色 */
}
#tb2 {
border-collapse: collapse /* 折叠边框产生细线表格*/
border: 1px solid red /* 细线表格,表格线为红色 */
}
</style>
</head>
<body>
<br>
<table id="tb1" width="379" height="87" border="1" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td width="123" height="34">&nbsp</td>
<td width="122">&nbsp</td>
<td width="126">&nbsp</td>
</tr>
<tr>
<td height="25">&nbsp</td>
<td>&nbsp</td>
<td>&nbsp</td>
</tr>
<tr>
<td>&nbsp</td>
<td>&nbsp</td>
<td>&nbsp</td>
</tr>
</tbody>
</table>
<br>
<table id="tb2" width="379" height="89" border="1" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td width="123" height="36">&nbsp</td>
<td width="122">&nbsp</td>
<td width="126">&nbsp</td>
</tr>
<tr>
<td height="25">&nbsp</td>
<td>&nbsp</td>
<td>&nbsp</td>
</tr>
<tr>
<td>&nbsp</td>
<td>&nbsp</td>
<td>&nbsp</td>
</tr>
</tbody>
</table>
</body>
</html>
显示结果:
这是设置的边框,将边框的样式设置为 dashed就行,举个例子:table{
width: 320px
height: 320px
}
tr td{
border:1px dashed #333
}
可以这样写