简体   繁体   中英

HTML Nested Table Not Nesting

I'm trying to make a nested table and its not working. It only works when I have a nested table following another table:

 <table> </table> <table> <tr> <td> <table> <tr> <td>C#</td> <td>⭐⭐⭐⭐</td> </tr> <tr> <td>MS SQL Server</td> <td>⭐⭐⭐</td> </tr> </table> </td> <td> <table> <tr> <td>HTML</td> <td>⭐⭐</td> </tr> <tr> <td>JavaScript</td> <td>⭐⭐</td> </tr> </table> </td> </tr> </table>

But if I have just the nested table without the first empty table it doesn't nest:

 <table> <tr> <td> <table> <tr> <td>C#</td> <td>⭐⭐⭐⭐</td> </tr> <tr> <td>MS SQL Server</td> <td>⭐⭐⭐</td> </tr> </table> </td> <td> <table> <tr> <td>HTML</td> <td>⭐⭐</td> </tr> <tr> <td>JavaScript</td> <td>⭐⭐</td> </tr> </table> </td> </tr> </table>

Here I end up getting a table with 4 rows each with two columns.

No need to use nested tables when you can use one table:

 <table> <tr> <td>C#</td> <td>⭐⭐⭐⭐</td> <td>HTML</td> <td>⭐⭐</td> </tr> <tr> <td>MS SQL Server</td> <td>⭐⭐⭐</td> <td>Javascript</td> <td>⭐⭐</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