I'm trying to achieve something like this:
I have a variable amount of data that is fetched from a database. I want to put each data received into a single cell and each cell side-by-side from other. At this point I could reach. You can think of a pokedex. Each pokemon info goes into a single cell (number, image, name).
My problem is: each cell has a fixed width, for example, 100 px. I want my table to create as many columns as possible according to window size. For example: if user window has 1345 px, my table will create 13 cells per row. But I want it to be responsive in realtime: if user resize his/her window to 890 px, my table would now have only 8 cells per row.
How can I achieve that?
Thanks!
EDIT: okay, some pointed me to a post I couldn't find on search. Following top voted answer from this post I kinda achieved what I wanted. It works when I'm using img inside my div. But in my case, I have div inside my div. Something like this:
<div class="wrapper">
<div>
<p>some text</p>
<img src="myimagepath.png" />
<p>more text</p>
</div>
</div>
In my example, wrapper makes just 1 column, not distributing to the whole page like it did when it was only img. How can I workaround this?
PS: I don't know if I should continue the thread on answer's post or continue here. Please let me know so we can close this thread and solve on the proper thread.