I have a table with some images, and it’s showed pretty good on the PC, but if i view my website with the smartphone the table is too large and it ruin all the mobile layout, there’s some way to fix it?
This is the link so you can see the problem: http://www.animeshare.it/lista-anime/.
I’d like to fit the number of columns based on the screen width.
That’s really hard to do with a table layout. I’m not sure if you are required to use a table, but I would suggest using the CSS3 flex-box model instead for better mobile compatibility.
In the example below, the contents of the
#grid
div will wrap depending on the size of the#grid
div.HTML
CSS
Please see my working fiddle here, I hope it helps.
NOTE: Flex-box is not without bugs since it’s a relatively new specification, you can learn more here.