Home > OS >  How do I fill with only one tr in multiple th table?
How do I fill with only one tr in multiple th table?

Time:12-29

I finding a way to fill all the space with one td in tbody

<table>
 <thead>
  <tr>
     <th>1</th>
     <th>2</th>
     <th>3</th>
  <tr>
 </thead>
 
 <tbody>
   <tr>
    <td>hi</td>
   </tr>
 </tbody>
</table>

example of table the above example shows that one image takes all the space off tbody

Is there a way to solve this with css?

CodePudding user response:

Just use the property colspan in That td:

th, td {
  border: 1px solid;
}
<table>
 <thead>
  <tr>
     <th>1</th>
     <th>2</th>
     <th>3</th>
  <tr>
 </thead>
 
 <tbody>
   <tr>
    <td colspan="3">hi</td>
   </tr>
 </tbody>
</table>

  • Related