Are there any other solutions to the problem of colspan="1.5" not working?
P粉368878176
P粉368878176 2024-03-30 09:12:41
0
1
573

This is the table I need I can get the first and second rows easily, but when I try to make the third row good, I'm breaking the second row.

I tried using width attribute and colspan but nothing worked.

<table border="1px" width="100%">
        <tr>
            <td colspan="6">Cell 1</td>
        </tr>
        <tr >
            <td colspan="3">Cell 2</td> 
            <td colspan="3" >Cell 3</td>
        </tr>
        <tr>
            <td colspan="2">Cell 4</td> 
            <td colspan="2">Cell 5</td>            
            <td colspan="2">Cell 6</td> 
        </tr>
    </table>

P粉368878176
P粉368878176

reply all(1)
P粉262073176

<table> will fit its content by default, so each column does not need to be equal width. So manually assign equal column widths by assigning table-layout:fixed to <table> and then assign each width to the first &lt ; in <thead> to allocate equal width to each column. tr> or missing allocated width for <td> of the first <tr> (of course td or th also works as a selector), see example below.

table {
  table-layout: fixed;
}

td {
  width: 16.5%;
  text-align: center;
}

I
II III
IV V VI
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template