Where is the best place to light the shabbos lights? is it better on the dining room table that we eat on or on a table right near it (my minhag is on the table but I heard if you light with oil you shouldnt light on the table because it might raise the fire when you bang the table, should I light with candles rather then oil to be able to keep it on the dining room table)?
It is permitted to have the candles on the table, and there is no need for concern in knocking on the table.
At the same time, it is equally fine to have the candles next to the table, on a nearby shelf, cabinet, piano, and so on.
The Shulchan Aruch (Orach Chaim 277:1) writes that it is forbidden to open and close a door where this will cause the oil to come closer or further from the wick. The reason for this is that this is considered hav’arah or kibui.
However, this will not apparently apply to candles with floating wicks, for which moving the table does not bring the oil nearer or further from the wick, and ought not to influence the size of the flame.
In fact, the Peri Megadim (Eishe Avraham, end of 277) writes explicitly that it is permitted to move the table with the candles on it (where there is no problem of muktzeh), and is clearly not concerned for the movement of the oil.
See also Piskei Teshuvos (277), who cites an opinion that is stringent on the matter, but cites a number of authorities who are lenient.
Therefore, it is fine to light on the table, which was clearly the custom for many (as noted in the Bach, Perishah, Peri Megadim, and other commentaries to Orach Chaim 277; see also Eliya Rabbah 277 and 279), and okay to continue knocking on the table.
At the same time, it is also fine to light next to the table, the purpose of the candles being that there should be light at the meal, and in honor of the Shabbos se’udah.