Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to color tables in css

enter image description here

How can i change the background-color as in the picture in css. Can you please help me.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

table, td, th {
  border: 1px solid;
}

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

.left {
  background-color:yellow;
}

.right {
  background-color:red;
}

td{
   height:16px;
}
<table>
 <tr>
  <td colspan="4"></td>
  
 </tr>
 <tr>
  <td colspan="2" class='left'></td>
  <td colspan="2" class = 'right'></td>
 
 </tr>
 <tr>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
 </tr>
</table>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading