ThymeLeaf Fragment executed on false th:if

Fragment inclusion has a higher operator precedence than th:if.

http://www.thymeleaf.org/doc/tutorials/2.1/usingthymeleaf.html#attribute-precedence

You'll probably have to move the th:if to a tag above. Either in the container div, or if you still need the container div, then a th:block like this:

<div class="container">
    <th:block th:if="${results}">
        <table th:replace="fragments/resultTable">
            <tr>
                <th>Talent</th>
                <th>Score</th>
            </tr>
            <tr>
                <td>Confidence</td>
                <td>1.0</td>
            </tr>
        </table>
    </th:block>
</div>

With Thymeleaf 3.0 you can use the no-operation token to insert/replace only if condition is met, something like this:

<table th:replace="${results} ? ~{fragments :: resultTable} : _">

https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#advanced-conditional-insertion-of-fragments