title: Thymeleaf Using th:if within a th:block
body: <p>I am new to thymeleaf and am trying to create an html table where a boolean decides whether the text will be pass or fail in some of the columns.</p>
  
  <p>SmokeTest.passOrFailArray is an array of booleans.
  Right now the smokeTest.name is showing up in the column but the passed or failed text is not showing up at all. </p>
  
  <p>Here is my thymeleaf/html code</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html xmlns:th="http://www.thymeleaf.org"&gt;
  &lt;head&gt;
  &lt;title&gt;Smoke Tests&lt;/title&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;table border="1" style="width:300px"&gt;
  &lt;tr&gt;
      &lt;td&gt;Test Name&lt;/td&gt;
      &lt;td th:each="testsThatRan : ${testsThatRan}"
      th:text="${testsThatRan}"&gt;Tests&lt;/td&gt;
  &lt;/tr&gt;
  &lt;th:block th:each="smokeTest : ${smokeTests}"&gt;
  &lt;tr&gt;
     &lt;td th:text="${smokeTest.name}"&gt;A Smoke Test'&lt;/td&gt;
     &lt;th:block th:each="smokeTest.passOrFailArray : ${smokeTest.passOrFailArray}"&gt;
          &lt;td th:if="${smokeTest.passOrFailArray} == true" th:text="Passed"&gt;&lt;/td&gt;
          &lt;td th:if="${smokeTest.passOrFailArray} == false" th:text="failed"&gt;&lt;/td&gt;
  
     &lt;/th:block&gt;
  &lt;/tr&gt;
  &lt;/th:block&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is the class that im using as a variable in thymeleaf</p>
  
  <pre><code>public testers() throws IOException {
  
      localPath = "/Users/dansbacher14/Documents/workspace/OBI_nightly_test/src/OBI_ci_scripts_tests";
      remotePath = "ssh://git@stash.ops.aol.com:2022/obi/obi_ci_scripts.git";
      localRepo = new FileRepository(localPath + "/.git");
      pathToSmoke = "BPS/GPS/GATHR/SMOKE";
      pathToODirectory = "test-results";
      git = new Git(localRepo);
  }
  
  public static &lt;C&gt; void testClone() throws IOException, InvalidRemoteException, TransportException, GitAPIException 
  {
  
      Git.cloneRepository().setURI(remotePath).setDirectory(new File(localPath)).call();
  }
  
  
  //____________SETTERS AND GETTERS __________________________________________________________________________________
  
  public void setName(String name)
  {
      jmxName = name;
  }
  
  public String getName()
  {
      return jmxName;
  }
  
  
  public boolean[] getPassOrFailArray()
  {
      return passOrFailArray;
  }
  
  public String getLocalPath()
  {
      return localPath;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>This is how the source code is presented by the browser.</p>
  
  <pre><code> &lt;!DOCTYPE HTML&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Smoke Tests&lt;/title&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;table border="1" style="width:300px"&gt;
  &lt;tr&gt;
      &lt;td&gt;Test Name&lt;/td&gt;
      &lt;td&gt;OBI01&lt;/td&gt;
      &lt;td&gt;DEV&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
     &lt;td&gt;authAmtTesting.jmx&lt;/td&gt;
  
  
  
  &lt;/tr&gt;
  
  
  &lt;tr&gt;
     &lt;td&gt;authTesting.jmx&lt;/td&gt;
  
  
  
  
  &lt;/tr&gt;
  
  
  &lt;tr&gt;
     &lt;td&gt;CC_Crypto.jmx&lt;/td&gt;
  
  
  
  
  
  &lt;/tr&gt;
  
  
  &lt;tr&gt;
     &lt;td&gt;ci_address.jmx&lt;/td&gt;
  
  
  &lt;/tr&gt;
  
  
  &lt;tr&gt;
     &lt;td&gt;ci_cardtype_negative.jmx&lt;/td&gt;
  
  
  
  &lt;/tr&gt;
  
  
  &lt;tr&gt;
     &lt;td&gt;ci_cardtype_positive.jmx&lt;/td&gt;
  
  
  &lt;/tr&gt;
  
  
  &lt;tr&gt;
     &lt;td&gt;promoSmokeTst.jmx&lt;/td&gt;
  
  
  
  &lt;/tr&gt;
  
  
  &lt;tr&gt;
     &lt;td&gt;tokenizedPayment.jmx&lt;/td&gt;
  
  
  &lt;/tr&gt;
  
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Is it possible to do something like this in thymeleaf?  If so how could I make this work?  Thanks</p>