title: Nested tables with thymeleaf
body: <p>I'm trying to get a thymeleaf page to show something like following on page:</p>
  
  <pre><code>Question 1:
  answer 1
  answer 2
  answer 3
  etc...
  </code></pre>
  
  <p>The amount of answers or questions in page is not known. But it can be calculated from a database if needed.</p>
  
  <p>I'm passing two separate list objects with model.addAttribute. One is called answer and one is called survey. I know both of them work, I can print list of questions or list of answers, but not both at the same time, in this format.</p>
  
  <p>I currently have this code in my HTML page</p>
  
  <pre><code>&lt;table class="table table-hover"&gt;
  
      &lt;tr th:each="survey : ${survey}"&gt;
          &lt;td th:text="${survey.name}"&gt;
  
              &lt;table class="second table"&gt;
                  &lt;tr th:each="answer : ${answer}"&gt;
                      &lt;td th:text="${answer.name}"&gt;&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  
  &lt;/table&gt;
  </code></pre>
  
  <p>How do I go about nesting the loop so I can present them in the page as shown in beginning?</p>
  
  <p>To be more clear: question = survey.name and answer = answer.name</p>