HTML中正确设置表格table边框border的三种办法

复制代码
<style>
    table {
        width: 400px;
        margin: 0 auto;
        border: 1px solid #000000;
        border-collapse: collapse;
    }
    
    th,
    td {
        border: 1px solid #000000;
        text-align: center;
    }
</style>

<table border="1">
    <tr>
        <th>第一列</th>
        <th>二列表头</th>
    </tr>
    <tr>
        <td><a target="_blank" href="http://www.cnblogs.com/tulater">涂磊的小作</a></td>
        <td>row 1, cell 2</td>
    </tr>
    <tr>
        <td>row 2, cell 1</td>
        <td>row 2, cell 2</td>
    </tr>
    <tr>
        <td>row 3, cell 1</td>
        <td><a target="_blank" href="https://www.cnblogs.com/tulater/p/18519255">实体书</a></td>
    </tr>
</table>
复制代码