По столу - on the table / along the table Под столом - under the table Над столом - above the table There is no "по столом", because you would need to either conjugate the word стол to столом if it's under it or above or conjugate it to столу if it's on it in this case. In other case conjugations can be different though, in example "стакан стоит на столе" = "a glass is on the table" because "на чём?" - "на столе" and "a cat walks on the table" = "кот/кошка ходит по столу" is that way because "ходить по чему? - по столу". "Над столом" never changes conjugation though. Но "под столом" may change if you, for example, would want to throw or place something under a table, then it becomes "под стол", because "под что?" - "под стол". The answer to Что is usually a neutral form. To find the right conjugation of a verb try asking those question in context to help yourself out.
I would just note that this question method works for native speakers who inherently know the declined form of question words. But learners don't inherently know the declined forms of, well, anything :) This led to some mass confusion way back in my 2nd-ish week of college Russian when my native-speaker instructor, who had never taught Russian for non-natives before tried to use it for us - for all the cases at once! She was met with the blankest of stares! We barely, barely knew what cases were yet. She righted course quickly enough and did an excellent job the rest of the year :)