title: Algorithm to get cell row and column in table
body: <p>I am building a function which will allow the user to choose a cell in a dynamically created table, by passing in an integer.<br>
  I.e., if I have a 3x3 grid, and the user passes in the number 4, the program should know that he wants the 1st cell in the second row. (the cells will be counted by rows)
  As I mentioned, the table is created dynamically and can be any size.<br>
  I can do this with a bunch of if statements, but I was wondering if there is maybe an algorithm to figure this out easily.  </p>
  
  <p>(P.S. I am using a very basic programming language, so please, no fancy pythonic math functions... :) )</p>