I am currently working on a project where I need to dynamically create tabs based on a list retrieved from my Spring backend using Thymleaf and Bootstrap. While I have managed to successfully create the tabs and content, I am facing an issue where the first tab does not open by default. However, it works fine when clicked.
<ul class="nav nav-tabs" >
<li class="nav-item" th:each="t, tNum: ${tx}">
<a class="nav-link" th:classappend="${tNum.first} ? 'active'" th:href="@{'#'+ ${t.ticker}}" data-toggle="tab"><label th:text="${t.ticker}">bar title</label></a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane" th:id="${t.ticker}"th:classappend="${tNum.first} ? 'active'" th:each="t, tNum: ${tx}">
<h3 th:text = "${t.ticker}">bar content</h3>
</div>
</div>