I'm trying to show divs dependent on whether a database entry has been made:

<table class="info-table">
<tr><td>
<div class="info-table_titlebox">
{% if post.wrk_1_title is defined %}
    <div class="info-title_title">
    <h2>{{post.wrk_1_title}}</h2>
    <h3>Facilitator: {{post.wrk_1_facilitator}}</h3>
    <h4>Location: {{post.wrk_1_locate}}</h4>
    <h4>Max participants: {{post.wrk_1_max}}</h4>
    </div>
    <div class="info-title_list">
        <ul>
        <li>{{post.eventday}} - <b>Week {{post.eventweek}}</b></li>
        <li class="info-title_listright">{{post.wrk_1_time}}</li>
        </ul>
    </div>
    <p>{{post.wrk_1_description}}</p>
{% endif %}
</div>
</td>
<td>
<div class="info-table_titlebox">
{% if post.wrk_1_title is defined and post.wrk_2_title is defined %} 
    <div class="info-title_title">
    <h2>{{post.wrk_2_title}}</h2>
    <h3>Facilitator: {{post.wrk_2_facilitator}}</h3>
    <h4>Location: {{post.wrk_2_locate}}</h4>
    <h4>Max participants: {{post.wrk_2_max}}</h4>
    </div>
    <div class="info-title_list">
        <ul>
        <li>{{post.eventday}} - <b>Week {{post.eventweek}}</b></li>
        <li class="info-title_listright">{{post.wrk_2_time}}</li>
        </ul>
    </div>
    <p>{{post.wrk_2_description}}</p>
{% endif %}
</div>
</td>

This is a simplified snippet - the pattern carries on. Basically if the title is in the database show only div1 if both title 1 and title 2 are in the database show div1 and div2 and so on.

Currently this sort of works as it shows the div I want to show

Edit
Report