html表格边框

2020-06-29 15:14:32易采站长站整理

HTML可以通过为表格添加border属性来添加边框。推荐学习:html教程

示例:

<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body>                   <table width="400" border="1" cellspacing="0" cellpadding="0">                 <tr>                 <td >示例</td>                 <td >网址</td>                 <td >示例</td>                 </tr>                 <tr>                 <td>示例</td>                 <td>示例</td>                 <td>示例</td>                 </tr>                 <tr>                 <td>示例</td>                 <td>示例</td>                 <td>示例</td>                 </tr>                 </table>        </body></html>

效果图:

1.jpg

border 简写属性在一个声明设置所有的边框属性。

可以按顺序设置如下属性:

border-width:规定边框的宽度。

border-style:规定边框的样式。

border-color:规定边框的颜色。