The result of the following process should be a html form. This form's structure varies from one to user. For example there might be a different number of rows or there may be the need for rowspan and colspan.

When the user chooses to see this table an ajax call is made to the server where the structure of the table is decided from the database. Then I have to create the html code for the table structure which will be inserted in the DOM via JavaScript.

The following problem comes to my mind: Where should I build the HTML code which will be inserted in the DOM? On the server side or should I send some parameters in the ajax call method and process the structure there? 

Therefore the main question involves good practice when it comes to decide between Server side processing or client side processing.

Thank you!

Forgetting things is normal. Not remembering some tricks that helped you in the past is also normal. This is the first step one should acknowledge. Then there are some ways you can "store" knowledge for further revision:


Find time and blog about it. The future-you will be very thankful to the present-you;
Work with tiny demos and archive them in some way. You will surely step through this archive many times;
Make use of your stackexchange profile. Mark interesting questions/problems/issues/tips/tricks as favorites for further investigation;
Keep doing, keep programming. The more you use a certain part of a framework, the more you familiarize with it and the more you remember.

