gpt4 book ai didi

java - 我想在 td 中放置一个动态值,在一个表中有很多 td,但我想将该值放置在特定的 td 中

转载 作者:太空宇宙 更新时间:2023-11-04 12:44:30 25 4
gpt4 key购买 nike

Here is my table where there have a 6 column, in this 6 column I want to place a dynamic value in Rule Id, Rule Name, then two column fill with static value then parameter and value will be fill with dynamic value, I am getting the value but unable to place according to column.

用于创建规则列表的Java类

public class CompArray {
public ArrayList<Rules> a1= new ArrayList<Rules>();

public CompArray (){
Rules rul = new Rules();
rul.setruleId("1001");
rul.setruleName("khagfkj");
rul.setParameter("lsrkjglkrs");
rul.setValue("lskdjfk");

a1.add(rul);

}
public ArrayList<Rules> getRules(){

return a1;
}

规则列表 Controller

@RequestMapping(value = "/demo", method = RequestMethod.GET)
public String listRules1(ModelMap model) {
CompArray obj1 = new CompArray();
model.addAttribute("listRule1", obj1.a1);
return "hello";
}

我想要将动态值放置在列中的 html 表格

<c:if test="${not empty listRule1}">
<table border ="2">
<tr>
<th align="center"><b>Rule ID</b></th>
<th align="center"><b> Rule Name </b></th>
<th align="center"><b>Rule Type </b></th>
<th align="center"><b>Rule Validity </b></th>
<th align="center"><b>Parameter </b></th>
<th align="center"><b>Value</b></th>
</tr>

<c:forEach items="${listRule1}" var="obj1">
<tr>
<td>${obj1.id}</td>
<td>${obj1.details}</td>
<td>${obj1.parameter}</td>
<td>${obj1.value}</td>

</tr>
</c:forEach>

</table></c:if>

如何将动态值放置在特定列中?请有人帮助我做到这一点。我尝试了很多解决方案,但无法解决这个问题。

最佳答案

再添加两个 td,如下所示。

<td>${obj1.id}</td> 
<td>${obj1.details}</td>
<td></td>
<td></td>
<td>${obj1.parameter}</td>
<td>${obj1.value}</td>

关于java - 我想在 td 中放置一个动态值,在一个表中有很多 td,但我想将该值放置在特定的 td 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36467327/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com