Issue On Scrolling to A Row in Table

Issue On Scrolling to A Row in Table

Can you please take a look at this DEMO and let me know how I can use jQuery to scroll to the selected row or animate that row to the middle of the scrolled div sc?

Here is the code:

  1. <div id="sc">
  2. <table id="mytable"></table>
  3. </div>
  4. <button class="25">Scrool to 25</button>
  5. <button class="75">Scrool to 75</button>
  6. <button class="125">Scrool to 125</button>
  7. <button class="199">Scrool to 199</button>
  8. <button class="0">Scrool to 0</button>
  9. <script>
  10. $(document).ready(function () {
  11.     for (var i = 0; i < 200; i++) {
  12.      $('#mytable').append('<tr class=' + i + '><td>This is Row' + i + ' </td></tr>');
  13.      $("#125").click(function() {
  14.      $('#sc').animate({
  15.     scrollTop: $("#sc").offset().top}, 2000);
  16.  });
  17.       }
  18. });
  19. <script>

Thanks alot