app/views/banners/_table.html.erb
<table class="usa-table">
<caption><h2 class="font-heading-xl">
<%= timing.capitalize %> messages
</h2></caption>
<% if timing == 'past' %>
<colgroup>
<col span="1" class="width-half">
<col span="1" class="width-quarter">
<col span="1" class="width-quarter">
</colgroup>
<% end %>
<thead>
<tr>
<th scope="col">Message</th>
<th scope="col">Start date</th>
<th scope="col">End date</th>
<% if timing == 'upcoming' %>
<th scope="col">Currently displayed</th>
<th scope="col">Actions</th>
<% end %>
</tr>
</thead>
<tbody>
<% banners.each do |banner| %>
<%= render partial: 'table_row', locals: { banner: banner, timing: timing } %>
<% end %>
</tbody>
</table>