<style>
  .A4 #index_table { /* index_table on top of title block */
    position: absolute;
    top: 20mm;
    left: 0;
    width:180mm;
  }

  .A3 #index_table, .A2 #index_table { /* index_table to the left of title block */
    position: absolute;
    {% if options.index_table_updated_position %}
    {{ options.index_table_updated_position }}
    {% elif options.index_table_on_right %}
    top: 20mm;
    right: 20mm;
    {% elif options.show_bom %}
    top: {{ 20 + (options.bom_rows + 2) * options.bom_row_height + 10}}mm;
    left: 10mm;
    {% else %}
    top: 20mm;
    left: 10mm;
    {% endif %}
  }

  #index_table tr {
    height: {{ options.index_table_row_height }};
  }

  #index_table tr:nth-child(odd) {
    background-color: #EEEEEE
  }

  #index_table table, th, td {
    border: 1px solid black;
    border-collapse: collapse;
    text-align: left;
  }

  #index_table .index_table_col_id {
    text-align: center;
    font-weight: bold;
  }

  #index_table .index_table_col_qty {
    text-align: right;
  }

</style>


<!-- index_table TEMPLATE --!>
<div id="index_table">
  <b> INDEX TABLE </b>
  <table>
    <!-- header --!>
    <tr>
      {% for item in index_table.header %}
      <td><b> {{ item }} </b></td>
      {% endfor %}
    </tr>
    <!-- content --!>
    {% for row in index_table.rows %}
    <tr>
    {% for item in row.get_items(options.for_pdf) %}
      <td> {{ item }} </td>
    {% endfor %}
    </tr>
    {% endfor %}
  </table >
</div>
