Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Colspan of 1.5 in a table

Tags:

html-table

Is it possible with HTML/CSS to create a table with three columns, where one row has only two cells. However, instead of one cell of that row being 66% (colspan="2") and the other being 33%, both to be 50% (so errh, colspan="1.5" which doesn't work as expected)

To illustrate what I mean: enter image description here

What I am talking about is the row which is in bold red, is this possible?

like image 311
Christof Kälin Avatar asked Oct 21 '25 02:10

Christof Kälin


1 Answers

Sure, just like the following:

table,
td {
  border: 1px solid #999;
}

td {
height: 20px;
width: 50px;
}
<table>
  <tr>
    <td></td>
    <td colspan="2"></td>
    <td></td>
  </tr>
  <tr>
    <td></td>
    <td colspan="2"></td>
    <td></td>
  </tr>
  <tr>
    <td colspan="2"></td>
    <td colspan="2"></td>
  </tr>
  <tr>
    <td></td>
    <td colspan="2"></td>
    <td></td>
  </tr>
</table>
like image 174
j08691 Avatar answered Oct 24 '25 23:10

j08691



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!