---
layout: default
---

<div class="post">
  <h1 class="post-title">{{ page.title }}</h1>
  <span class="post-date">{{ page.date | date_to_string }}</span>
  
  <div id="renderTOC">
    <table class="toc" id="toc"><tbody><tr><td>      
      <div id="toctitle"><strong>Contents</strong></div>
      <ol data-toc="div.container" data-toc-headings="h2,h3"></ol>
    </td></tr></tbody></table>    
  </div>

  {{ content }}
</div>

---
layout: default
---

<div class="post">
  <h1 class="post-title">{{ page.title }}</h1>
  <span class="post-date">{{ page.date | date_to_string }}</span>
  
  <div id="renderTOC">
    <table class="toc" id="toc"><tbody><tr><td>      
      <div id="toctitle"><strong>Contents</strong></div>
      <ol id='toccontainer' data-toc="div.container" data-toc-headings="h2,h3"></ol>
    </td></tr></tbody></table>
    <script>
      $( document ).ready(function() {
        if( $("#toccontainer li").length <= 0 ) {
          $("#renderTOC").hide();          
        }
      });
    </script>

    
        
  </div>

  {{ content }}
</div>

Hide the TOC when there are no elements.
Hide the TOC when there are no elements. 

