Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thymeleaf - Click able URL (Web link) in Table

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

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>
like image 455
Liam Blake Avatar asked Nov 20 '25 10:11

Liam Blake


1 Answers

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>
like image 93
Metroids Avatar answered Nov 22 '25 01:11

Metroids



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!