Expand button to cover full cell with colspan and rowspan

I need to insert a button inside a cell in a table. This button should fit entirely the cell.

<td colspan="2" rowspan="2">
   <button class="btn btn-default btn-block m-0" style="height:100%;">
       Button
   </button>
</td>

I tried the above code but the actual button it covers only the first row of the joined cells.

1 answer

  • answered 2019-10-15 20:53 AnHa

    Is this what are you looking for?

    The button row takes tha space of the below row as well

    <table>
          <thead></thead>
          <tbody>
            <tr>
              <td>Lorem ipsum</td>
              <td>dolor sit amet</td>      
              <td>test3</td>
            </tr>
            <tr>
              <td colspan="2" rowspan="2">
                <button class="btn btn-default btn-block m-0" style="height:100%;">
                Button
               </button>
              </td>
              <td>test3</td>
            </tr>
            <tr>
              <td>Lorem ipsum</td>
              <td>dolor sit amet</td>      
              <td>test3</td>
            </tr>
          </tbody>
        </table>