Jquery - difference between previous row : I have the following table:

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

    <table>
    <tr>
    <th>Year</th>
    <th>Total</th>
    <th>Diff</th>
    <th>Percentage</th>
    </tr>




    <tr>
    <td>2017</td>
    <td>80,000</td>
    <td>?</td>
    <td>?</td>
    </tr>

    <tr>
    <td>2016</td>
    <td>65,000</td>
    <td>?</td>
    <td>?</td>
    </tr>

    <tr>
    <td>2015</td>
    <td>59,000</td>
    <td>?</td>
    <td>?</td>
    </tr>

    <tr>
    <td>2014</td>
    <td>32,000</td>
    <td>?</td>
    <td>?</td>
    </tr>

    </table>

<!-- end snippet -->

Where the question marks are for DIFF and % I need to compare previous rows against each other and work out the difference in total and by percentage.

I relatively new to jquery and completely bewildered on how to achieve this.

Any help would be amazing.