<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'parents')}">

  <body>

    <h2>Parents</h2>

    <table id="doctors" class="table table-striped">
        <thead>
        <tr>
            <th style="width: 150px;">Name</th>
            <th style="width: 200px;">Address</th>
            <th>City</th>
            <th style="width: 120px">Telephone</th>
            <th>Children</th>
        </tr>
        </thead>
        <tbody>
          <tr th:each="parent : ${selections}">
              <td>
                  <a th:href="@{parents/__${parent.id}__}" th:text="${parent.firstName + ' ' + parent.lastName}"/></a>
              </td>
              <td th:text="${parent.address}"/>
              <td th:text="${parent.city}"/>
              <td th:text="${parent.telephone}"/>
              <td><span th:each="kid : ${parent.kids}" th:text="${kid.name} + ' '"/></td>
          </tr>
        </tbody>
    </table>

  </body>
</html>
