Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple rows in a td

Tags:

html

I've spent some time figuring out how to do this, and I figured out I'm really not good at html tables..

Need help how to actually do this.

Here is my base code I'm stuck with, No need for the table header

<table border="1" width="100%" height="300px">
  <tbody>
    <tr>
      <td rowspan="3">
        Physical Accomplishment
      </td>
      <td>Projected</td>
      <td>Weekly Cumulative</td>
    </tr>
    <tr>
      <td>Actual</td>
      <td>Weekly Cumulative</td>

    </tr>
    <tr>
      <td>Slippage</td>
      <td>Weekly Cumulative</td>
    </tr>
  </tbody>
</table>

Here's what I'm aiming for:

enter image description here

like image 335
Renz M Avatar asked Dec 17 '22 16:12

Renz M


1 Answers

Use rowspan 6 for the first column and rowspan 2 for the second and third column

<table border="1" width="100%" height="300px">
   <tbody>
      <tr>
         <td rowspan="6">
            Physical Accomplishment
         </td>
         <td rowspan="2">Projected</td>
         <td rowspan="2">Weekly Cumulative</td>
         <td>10%</td>
         <td>20%</td>
         <td>30%</td>
         <td>40%</td>
      </tr>
      <tr>
         <td></td>
         <td></td>
         <td></td>
         <td></td>
      </tr>
      <tr>
         <td rowspan="2">Actual</td>
         <td rowspan="2">Weekly Cumulative</td>
         <td></td>
         <td></td>
         <td></td>
         <td></td>
      </tr>
      <tr>
         <td></td>
         <td></td>
         <td></td>
         <td></td>
      </tr>
      <tr>
         <td rowspan="2">Slippage</td>
         <td rowspan="2">Weekly Cumulative</td>
         <td>10%</td>
         <td>20%</td>
         <td>30%</td>
         <td>40%</td>
      </tr>
      <tr>
         <td></td>
         <td></td>
         <td></td>
         <td></td>
      </tr>
   </tbody>
</table>
like image 194
klugjo Avatar answered Jan 05 '23 18:01

klugjo