This is a bit of a math problem mixes with some JavaScript, I have this adjustable div
(https://i.stack.imgur.com/1Pwj9.jpg), when clicking on submit
it will be filled entirely by 10 by 10 smaller div's
.
But I don't quite know how to calculate how many row's of 10 by 10 div's
will fit into the parent
.
What I currently have is this code:
var w_items = Math.ceil(def_w / 10),
h_items = Math.ceil(def_h / 10);
That give's me back the rounded width
and height
of said parent
, don't know how to calculate how many would fit thought, do I add them together or something?