Answers.Body: <p>Assuming your example code, something along these lines will help...</p>
  
  <pre><code>{% if entry.yourTable | length %}
      &lt;table&gt;
      {% for row in entry.yourTable %}
      &lt;tr&gt;
         &lt;td&gt;{{ row.column1 }}&lt;/td&gt;&lt;td&gt;{{ row.column2 }}&lt;/td&gt;&lt;td&gt;{{ row.column3 }}&lt;/td&gt;
      &lt;/tr&gt; 
      {% endfor %}
      &lt;/table&gt;
  {% endif %}
  </code></pre>
  
  <p>Here's the relevant section in the docs: <a href="https://craftcms.com/docs/table-fields#templating" rel="nofollow noreferrer">Table fields</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-23T15:50:24.070Z
Answers.LastActivityDate: 2016-12-23T15:50:24.070Z
Answers.UserDisplayName: Steve Holland
Body: <p>Need a hand on a conditional to see if my table has any data, and if it does, output the table. The second thing I  need help is the code to output the table. When I look at tutorials, they always seem to output the table as an HTML list. Like:</p>
  
  <pre><code>   {% if block.codePoints | length %}
      &lt;ul&gt;
      {% for row in block.codePoints %}
           {# Assuming 'text' is the column handle of the text field #}
          &lt;li&gt;{{ row.text }}&lt;/li&gt; 
      {% endfor %}
      &lt;/ul&gt;
  {% endif %}
  </code></pre>
  
  <p>I can't find an example of:</p>
  
  <pre><code>&lt;table&gt;
  &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Thanks.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-23T03:31:04.777Z
Comments.Text: Is `block` a Matrix block?  If so, what type of field is `codePoints`?  Or is `block` the name of an entry and `codePoints` is a table field?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-23T13:08:38.413Z
Comments.Text: I'm unclear about the example code. It isn't my code but what I found on Stack Exchange. I just used it as an example. I can't seem to find an example to output a table using <table> mark-up. And also need to check to see if table is blank. Each table has 1 row of blank so my condition is failing.
Comments.UserDisplayName: DevServe
Tags: <entry><conditional><table>
Title: Conditionals and outputting tables
ThreadText: # Conditionals and outputting tables
  
  (Asked by: username_0 on 2016-12-23)
  
  Need a hand on a conditional to see if my table has any data, and if it does, output the table. The second thing I need help is the code to output the table. When I look at tutorials, they always seem to output the table as an HTML list. Like:
  
  ```
     {% if block.codePoints | length %}
      <ul>
      {% for row in block.codePoints %}
           {# Assuming 'text' is the column handle of the text field #}
          <li>{{ row.text }}</li> 
      {% endfor %}
      </ul>
  {% endif %}
  
  ```
  
  I can't find an example of:
  
  ```
  <table>
  <tr><td></td><td></td><td></td></tr>
  </table>
  
  ```
  
  Thanks.
  
  **Tags:** entry, conditional, table
  
  > **Comments:**
  > **username_1**: Is `block` a Matrix block?  If so, what type of field is `codePoints`?  Or is `block` the name of an entry and `codePoints` is a table field?  
  > **username_0**: I'm unclear about the example code. It isn't my code but what I found on Stack Exchange. I just used it as an example. I can't seem to find an example to output a table using <table> mark-up. And also need to check to see if table is blank. Each table has 1 row of blank so my condition is failing.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-12-23. Score: 2 | Accepted answer
  
  Assuming your example code, something along these lines will help...
  
  ```
  {% if entry.yourTable | length %}
      <table>
      {% for row in entry.yourTable %}
      <tr>
         <td>{{ row.column1 }}</td><td>{{ row.column2 }}</td><td>{{ row.column3 }}</td>
      </tr> 
      {% endfor %}
      </table>
  {% endif %}
  
  ```
  
  Here's the relevant section in the docs: [Table fields](https://craftcms.com/docs/table-fields#templating)
  
  
  ---
  
  