html table column,HTML Table Column after Column

博客探讨如何在HTML中按列而非行动态创建表格,特别是处理不同大小的数组数据。作者提出需要根据多个数组来生成一表格,每个数组对应表格的一列。问题涉及到遍历数组并构建表格结构,询问是否可以先写第一列再写后续列。解决方案可能涉及使用循环和JavaScript进行动态生成。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Is it possible to write the first column in a table in HTML and then the next column? If you write it like this:

Test1Test2Test3
Test4Test5Test6
Test7Test8Test9

You just write the first row and then the second row. But I want to write the first column first. Is this possible?

Edit:

I have 5 Arrays with different sizes. They all include Strings.

Array1[2]: "Thomas", "Jon"

Array2[3]: "Bob", "Karl", "Jake"

Array3[4]: "Stephan", "Barack", "Steve", "Nicole"

Array3[1]: "Robert"

Array5[4]: "Carla", "Carlos", "Niggel", "Cedric"

The Header of the Tables should include the workdays. At the end I will have a Table with 5 Rows and some columns. To create this table I need to write the first Columne with a Loop for the 1. Array. Then a second Column for the second Array and so on. Right?

Do you have another idea how to write this table? I hope you understand my problem.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值