Lock layer to table

I have a table that is centered on the page.

I have a layer that is hidden.

There is a button that when pressed shows the hidden layer.

When the layer is displayed I want it to hide the table.

Is there a way I can set the position of the layer relative to the table?