Daniel_V Daniel_V -4 years ago 66
CSS Question

colspan doesn't accept decimal numbers. How do I specify the span?

<table>
<thead>
<th colspan="4">Liquor Store Blues</th>
</thead>
<tbody>
<tr>
<td colspan="4">Meow</td>
</tr>
<tr>
<td colspan="2">Meow</td>
<td colspan="2">Meow</td>
</tr>
<tr>
<td colspan="1.33">Meow</td>
<td colspan="1.33">Meow</td>
<td colspan="1.33">Meow</td>
</tr>
<tr>
<td>Meow</td>
<td>Meow</td>
<td>Meow</td>
<td>Meow</td>
</tr>
</tbody>
</table>


I have got an image of it over here: http://i.imgur.com/myKN33l.png

Wanted to set each
td
's
colspan
in the 4th row to
1.44
but then I came to know that
colspan
doesn't take decimal numbers. So how do I do it? Should I have to use CSS? If so, how?

Answer Source

Because of your 4th row having 3 elements, your table actually has 12 columns, not 4.

http://cssdeck.com/labs/9lzcwolh

td {
  border: 1px solid;
}
<table>
    <thead>
        <th colspan="12">Liquor Store Blues</th>
    </thead>
    <tbody>
        <tr><td colspan="12">A1</td> </tr>
      
        <tr><td colspan="6">B1</td><td colspan="6">B2</td></tr>
      
        <tr><td colspan="4">C1</td><td colspan="4">C2</td><td colspan="4">C3</td></tr>
      
        <tr><td colspan="3">D1</td> <td colspan="3">D2</td> <td colspan="3">D3</td><td colspan="3">D4</td></tr>
    </tbody>
</table>

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download