title: html - change number of columns and rows with a fixed size as the size of page changes
body: <p>let's say i have 20 items and i want to display those in rows and in columns(basically in a table) in a html page. If the width of the page is 1360px and the width of each item is 128px then there would be 10 columns and 2 rows as shown below.</p>
  
  <p><img src="https://i.stack.imgur.com/EoQjb.png" alt="enter image description here"></p>
  
  <p>and if the width of the page is decreased to 1024px then there would be 8 columns in the first and second row and 4 columns in the third row as shown below</p>
  
  <p><img src="https://i.stack.imgur.com/9mfTh.png" alt="enter image description here"></p>
  
  <p>basically i want to change the number of rows and columns for a given number of items dynamically to fit the page given that the height and width of each cell is 128x128 pixels.</p>