marduc812
marduc812

Reputation: 1205

CSS Remove table's border

I have a Wordpress Template installed so the table takes the style that was given. I managed to change tables color for background and text but I couldn't remove the frame around the table (border). I found a lot of related results but I couldn't find something that worked for me (I'm not that much experienced with CSS).

body {
  background: #040404;
}

table.photos_table td {
  background-color: #040404 !important;
  color: white !important;
}
table.photos_table {
  border: none !important;
  border-collapse: collapse !important;
}
<table class="photos_table">
  <tbody>
    <tr>
      <td>food</td>
      <td>drink</td>
    </tr>
    <tr>
      <td>pizza</td>
      <td>soda</td>
    </tr>
  </tbody>
</table>

This is what I get as a result.

Border is still visible

Any suggestions what could be wrong? Do I need an other option?

Upvotes: 1

Views: 64

Answers (2)

Zigsaw Consultancy
Zigsaw Consultancy

Reputation: 135

Check for border attribute in style.css file. I am assuming border has been assigned to either td or tr attribute in style.css file.

This should fix it.

Upvotes: -1

Praveen Kumar Purushothaman
Praveen Kumar Purushothaman

Reputation: 167172

The border is in the <tbody>, so giving:

table thead, table tbody, table tfoot {border: none;}

Works...

preview

Upvotes: 2

Related Questions