What you are trying to accomplish is usually called responsive design , and there are a number of good solutions like bootstrap that provide all the necessary functionality.
I would suggest using something other than tables for layout (divs are nice). However, if you are presenting data, tables have been made for this.
I highly recommend that you look for a library / layout structure, especially if you deal with tabular data , they have well-established templates that will help you identify your design decisions and give you a decent plan for reprogramming the layout.
These types of frameworks will take into account situations where a simple layout suddenly becomes more complex.
source share