Thymeleaf - 单击表中的 URL(Web 链接) [英] Thymeleaf - Click able URL (Web link) in Table

查看:29
本文介绍了Thymeleaf - 单击表中的 URL(Web 链接)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(我在谷歌上看过,这里..并没有找到可以帮助我的答案).

(I have looked on google, here.. and havent been able to find the answer that could help me).

目标:作为可点击的网络链接输入的网站- 从数据库中检索链接作为 varchar(100)

Goal : Website to be entered as a click able web link - Link is retrieved from DB as a varchar(100)

尝试了各种不同的解决方案......没有任何运气 - 也许你们中的一个可以帮助我?:).提前致谢.

Tried all kinds of different solutions.. without any luck - Maybe one of you guys can help me out ? :). thank you in advance.

 <table class="table table-striped table-bordered table-hover">

    <thead>

    <tr>
        <th>Id</th>
        <th>Name</th>
        <th>Address</th>
        <th>City</th>
        <th>Zip</th>
        <th>Website</th>
        <th>Email</th>
        <th>Phone</th>
        <th>Location</th>
        <th>Agelimit</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="sps: ${sp}">
        <td th:text="${sps.venueId}"/>
        <td th:text="${sps.name}"/>
        <td th:text="${sps.address}"/>
        <td th:text="${sps.city}"/>
        <td th:text="${sps.zip}"/>
        <td th:text="${sps.website}"/>
        <td th:text="${sps.email}"/>
        <td th:text="${sps.phone}"/>
        <td th:text="${sps.location}"/>
        <td th:text="${sps.ageLimit}"/>


    </tr>
    </tbody>
</table>

推荐答案

您可以在 Thymeleaf 中使用任何类型的标签.这是你想要的吗?

You can use any type of tag with Thymeleaf. Is this what you want?

<td>
    <a th:href="${sps.website}" th:text="${sps.website}" target="_blank" />
</td>

这篇关于Thymeleaf - 单击表中的 URL(Web 链接)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆