How to merge the cells of a table

2

Good evening! I'm doing a WHILE of data coming from the database to a table using css but I could not get the table cells to stick together and with the same border. An example of the table I did:

table{
   width: 100%;
}

table td{
   padding: 10px;
   text-align: center;
   border: 1px solid black;
}
<table>
   <tr>
      <td>
         OK
      </td>
      <td>
         OK
      </td>
      <td>
         OK
      </td>
      <td>
         OK
      </td>
   </tr>
</table>

How to remove these spaces between cells using only css?

    
asked by anonymous 12.08.2018 / 09:09

1 answer

3

If I understand the problem, they are simply the attributes

border-spacing: 0;
border-collapse: collapse;

table
{
            width: 100%;
            border-spacing: 0;
            border-collapse: collapse;
}

table td
{
            padding: 10px;
            text-align: center;
            border: 1px solid black;
            
}
<table>
            <tr>
                <td>
                    OK
                </td>
                <td>
                    OK
                </td>
                <td>
                    OK
                </td>
                <td>
                    OK
                </td>
            </tr>
        </table>

More details can be found at link

Similar question: link

    
12.08.2018 / 12:18