I am trying to iterate through a bootstrap table. I have created if statements so I can get my desired output.

This is my desired output:
[![enter image description here](https://i.stack.imgur.com/btQwN.png)](https://i.stack.imgur.com/btQwN.png)

However, so far no value appears in the print cost and paper cost columns but the values appear on the first row if you take out the second row.

My HTML:

```
 <div class="card">
                <div class="card-header">Latest Print Jobs</div>

                <div class="card-body" style="padding:0px;">
                    <table class="table">
                        <thead>
                            <th>#</th>
                            <th>Employee Name</th>
                            <th>Job Number</th>
                            <th>Paper Size</th>
                            <th>Paper Type</th>
                            <th>Single or Doubled Sided</th>
                            <th>Quantity</th>
                            <th>Colour</th>
                            <th>Date</th>
                            <th>Edit</th>
                            <th>Print Cost</th>
                            <th>Paper Cost</th>
                            <th>Total Price</th>
                        </thead>
                        <tbody id="main-table">

                                      <tr>
                                       <td>14</td> 
                                        <td>Jafar</td> 
                                        <td>HCH_003</td> 
                                       <td>A3</td> 
                                        <td>Sirio Perla</td> 
                                         <td>Single</td> 
                                         <td>9</td> 
                                        <td>Black & White</td> 
                                         <td>2018-11-21 16:05:29</td> 
                                      <td> <a href="http://portal.test/prints/14" class="btn btn-default">Edit</a></td> 
                                      <td></td>
                                      <td></td>
                                      <td></td>
                                      </tr>

                                      <tr>
                                       <td>15</td> 
                                        <td>Jafar</td> 
                                        <td>HCH_099</td> 
                                       <td>A4</td> 
                                        <td>Sirio Perla</td> 
                                         <td>Single</td> 
                                         <td>9</td> 
                                        <td>Black & White</td> 
                                         <td>2018-11-21 16:20:22</td> 
                                      <td> <a href="http://portal.test/prints/15" class="btn btn-default">Edit</a></td> 
                                      <td></td>
                                      <td></td>
                                      <td></td>
                                      </tr>

                        </tbody>

                    </table>
                </div>
            </div>

```

My jQuery:

```
$(document).ready(function() {
  $("tr").each(function() {
    var paper_size = $("#main-table > tr > td:nth-child(4)").text();
    var paper_type = $("#main-table > tr > td:nth-child(5)").text();
    var single_or_double = $("#main-table > tr > td:nth-child(6)").text();
    var colour = $("#main-table > tr > td:nth-child(8)").text();
    var print_cost = $("#main-table > tr > td:nth-child(11)");
    var paper_cost = $("#main-table > tr > td:nth-child(12)");

    if (
      paper_type == "Sirio Perla" &&
      paper_size == "A4" &&
      colour == "Black & White"
    ) {
      $(print_cost).text("0.5");
      $(paper_cost).text("0.35");
    } else if (
      paper_type == "Sirio Perla" &&
      paper_size == "A4" &&
      colour == "Colour"
    ) {
      $(print_cost).text("2.5");
      $(paper_cost).text("0.35");
    } else if (
      paper_type == "Sirio Perla" &&
      paper_size == "A3" &&
      colour == "Black & White"
    ) {
      $(print_cost).text("0.1");
      $(paper_cost).text("0.6");
    } else if (
      paper_type == "Sirio Perla" &&
      paper_size == "A3" &&
      colour == "Colour"
    ) {
      $(print_cost).text("0.5");
      $(paper_cost).text("0.6");
    }
  });
});

```

my codepen to my problem is <https://codepen.io/mrsalami/pen/QJQGjj>