简体   繁体   中英

Creating complex table structure without using css

I am trying to make this table in HTML without using CSS, but I am not getting the desired output. I have tried a bunch of other combinations for the row with 6:2:3 rowspan.

This is the desired output

This is the code I am using.

 <!doctype html> <html> <head> <title>Table</title> </head> <body> <table border="1"> <tr> <th rowspan="3">&nbsp;</th> <th colspan="3">&nbsp;</th> </tr> <tr> <th colspan="2">&nbsp;</th> <th rowspan="2">&nbsp;</th> </tr> <tr> <th>&nbsp;</th> <th>&nbsp;</th> </tr> <tr> <td rowspan="2">&nbsp;</td> <td rowspan="2">&nbsp;</td> <td rowspan="2">&nbsp;</td> <td >&nbsp;</td> </tr> <tr> <td >&nbsp;</td> </tr> <tr> <td rowspan="6">&nbsp;</td> <td rowspan="2">&nbsp;</td> <td rowspan="2">&nbsp;</td> <td rowspan="3">&nbsp;</td> </tr> <tr> <td rowspan="2">&nbsp;</td> <td rowspan="2">&nbsp;</td> </tr> <tr> <td rowspan="2">&nbsp;</td> <td rowspan="2">&nbsp;</td> <td rowspan="3">&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> </body> </html> 

Done Heights may not be set but it works properly

 table, td { border: 1px solid black; } td { height: 50px; } 
 <table style="width:100%"> <tr> <td>5</td> <td colspan="3"> <table style="width:100%"> <tr> <td> <table style="width:100%;margin-top:50px;"> <tr> <td>6</td> </tr> </table> </td> <td>7</td> </tr> </table> </td> </tr> <tr> <td>8</td> <td>9</td> <td>10</td> <td> <table style="width:100%"> <tr> <td>11</td> </tr> </table> <table style="width:100%"> <tr> <td>12</td> </tr> </table> </td> </tr> <tr> <td></td> <td class="not"> <table style="width:100%"> <tr> <td>13</td> </tr> <tr> <td>14</td> </tr> <tr> <td>15</td> </tr> </table> </td> <td colspan="2"> <table style="width:100%"> <tr> <td>16</td> </tr> <tr> <td>17</td> </tr> </table> </td> </tr> <tr> <td>18</td> <td>16</td> <td>20</td> <td>21</td> </tr> </table> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM