怎样用css来设定表格的形状?

html-css011

怎样用css来设定表格的形状?,第1张

圆角的边框需要css2支持,而现在大都浏览器不能用css2,

css1要达到圆角可以用(很麻烦):

<style type="text/CSS">

div#nifty{margin:0}

div.rtop {display:blockbackground:#fff}

div.rtop div {display:blockheight:1pxoverflow:hidden}

div.r1{margin:0 5px}

div.r2{margin:0 3px}

div.r3{margin:0 2px}

div.rtop div.r4 {margin:0 1pxheight:2px}

</style>

<div id="nifty">

<div class="rtop">

<div class="r4"></div>

<div class="r3"></div>

<table style="border:0pt"></table>

<div class="r2"></div>

<div class="r1"></div>

</div>

</div>

下面来个例子,你可以复制到你的编辑器里修改测试

<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(标准通用标记语言的一个子集)等文件样式的计算机语言。