遍历数据与页面bug修改

遍历数据与页面bug修改

退出的按钮的更改

<li><a th:href="@{/}"><i class="fa fa-sign-out"></i> Log Out</a></li>                     

遍历数据

@GetMapping("/dynamic_table.html")
    public String dynamic_table(Model model){
    
    
        //表格内容的遍历
        List<User> users = Arrays.asList(new User("ayan", "123456"),
                new User("achao", "123444"),
                new User("haha", "aaaaa"),
                new User("hehe ", "aaddd"));
        model.addAttribute("users",users);

        return "table/dynamic_table";
    }

页面 dynamic_table

<table class="display table table-bordered" id="hidden-table-info">
    <thead>
        <tr>
            <th>#</th>
            <th>用户名</th>
            <th>密码</th>
        </tr>
    </thead>
    <tbody>
        <tr class="gradeX" th:each="user,stats:${users}">
            <td th:text="${stats.count}">Trident</td>
            <td th:text="${user.userName}">Internet</td>
            <td >[[${user.password}]]</td>
        </tr>
    </tbody>
</table>

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_51600120/article/details/114693279
今日推荐