Usually dedicating yourself to PHP also means HTML and the rest of it.
is there an elegant php solution to fill a html tables with a sql query without recreating the whole page
Hmm. Not sure I entirely understand this question? But there is no such solution that I am aware of you may try Google, Sourceforge etc.