Java 如何使用wicket生成表头

Java 如何使用wicket生成表头,java,html,wicket,Java,Html,Wicket,我想通过wicket生成这个表头 <tr> <th>Actions</th> <th>ID</th> <th>First Name</th> <th>Last Name</th> <th>Home Phone</th> <th>Cell Phone</th> </tr> 好的是,d

我想通过wicket生成这个表头

<tr>
    <th>Actions</th>
    <th>ID</th>
    <th>First Name</th>
    <th>Last Name</th>
    <th>Home Phone</th>
    <th>Cell Phone</th>
</tr>
好的是,div标记并没有显示在生成的html代码中。 我不知道当我只想要
th
而不需要
span
标签时应该使用什么标签

        <tr>
            <div wicket:id="seasonNames"><th wicket:id="season">[season]</th></div>
        </tr>

[季节]

一种方法是使用DataTable组件。在这种情况下,您必须传递
IColumn
实例列表并使用HeaderToolbar。有关此方法,请参见Wicket示例


另一种方法是使用简单的转发器,如RepeatingView或ListView。在这种情况下,
wicket:id=“seasonNames”
应改为。

您不能直接在其中添加任何html代码,而不是和。这是错误的是的,我知道。但是,添加id=seasonNames的wicket组件的正确解决方案是什么呢。有什么问题吗?是的,因为seasonNames是一个值列表,但值位于id=SeasonName的组件中,但您需要在单个组件中包含所有季节?对吗?季节名称不能在tr上,因为这样它将创建tr元素列表,但我只需要1个tr元素
        <tr>
            <div wicket:id="seasonNames"><th wicket:id="season">[season]</th></div>
        </tr>