So, if the width of each rib is always the same, you need to make a formula that calculates the with of each joint (inbetween the ribs) in order to get the the right door width because the number of ribs is not always the same I asume becasue the door width can vary.

Something like

Width/(rib width) = 10.3 (for example)

You need to round down the 10.3 so 10

Then calculate the total width of those 10 ribs so 10*(rib width)

Then calculate the difference between the door width and the total rib width to get the total joint width

Finally total joint width / (number of ribs-1) to get the width of 1 joint

Array the ribs with the round down number

And dimension and lock the joint width

at certain door widths you might end up with a very small joint, but this means you either need to make a wider door or use smaller ribs, like in real life

All from the top of my head, so I might be missing something here, but that is basically how I did something similar.