简体   繁体   中英

CSS Table Border Does not Collapse

I have a table like this and I am adding the border-bottom. There is space between the columns. I cannot figure where I did wrong. What should I do here?

在此处输入图片说明

#T_e5208500_98ac_11e7_a588_1866da2de39f table {
    border-collapse: collapse;
    table-layout: fixed;
}        
#T_e5208500_98ac_11e7_a588_1866da2de39f th,td {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    width: 67px;
}        
#T_e5208500_98ac_11e7_a588_1866da2de39f th {
    text-align: left;
    border-bottom: 1px solid black;
}      
#T_e5208500_98ac_11e7_a588_1866da2de39f td {
    text-align: right;
}     

You can try including below lines in your CSS code

table{
border-spacing : 0;
}

Sample Example

try this snippet:

#T_e5208500_98ac_11e7_a588_1866da2de39f table,th,td{
    border-collapse: collapse;
}

It was missing some HTML but here is a simple solution

<table>
    <thead>
        <th>Header 1</th>
        <th>Header 2</th>
    </thead>
    <tr>
        <td>Hello Header</td>
        <td>Hello Header</td>
    </tr>
</table>

and the css

table {
    border-collapse: collapse;
    table-layout: fixed;
}

th,td {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    text-align: left;
    padding-right: 5px;
}
thead{
    border-bottom: 1px solid black;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM