Table Mountain was formed by a process called uplift, where a large block of the Earth's crust was pushed upwards. This uplift happened over millions of years, and the flat top of the mountain is a result of erosion by wind and rain.
There is no evidence of volcanic activity in the area.