簡體   English   中英

不使用CSS創建復雜的表結構

[英]Creating complex table structure without using css

我正在嘗試在不使用CSS的情況下以HTML制作此表,但沒有得到所需的輸出。 我已經嘗試了6:2:3 rowpan的行的其他組合。

這是所需的輸出

這是我正在使用的代碼。

 <!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> 

可能沒有設置“完成高度”,但是它可以正常工作

 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> 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM