I have to work with an old templating system to display shopping products on a web page. Today, all products are displayed one by row with all the details
P1
P2
P3
P4
This old software uses a pair of tags <ED_START> <ED_END> to mark the product template that must be repeated in the HTML page. In fact, each product has its own HTML table. It works up to day.
What now I want is to reduce display size by displaying elements horizontally and vertically, like
P1 P2
P3 P4
P5 P6
or
P1 P2 P3
P4 P5 P6
according to screen resolution.
I know that if I change the product template to be a <td>, then the browser will try to render 10 or more products on the same row, which is exactly what I don’t want.
Normally, I would insert a </tr><tr> every 2 elements, but this templating system (this is a legacy proprietary software) doesn’t allow that. The template must be the same for all items, pure HTML plus their own markers for price, description, picture, etc.
My question is
How to I create in HTML a table that adapts the number of columns to available screen size (in other words, auto wrap columns as needed)? JavaScript and jQuery are usable.
What you want is a responsive design , twitter bootstrap is a good example of that.