How can i place my cards(buttons) according to screen size at runt time (c# Unity)?

i am arranging cards at run time by following code.
for (int i = 0; i < 52; i++) {

		if (i % 4 == 0) {
			b1 _.transform.position = new Vector3 ((400 + 5 * i), 730, 1);_

_ historySprite = newSprite [pickNo ()];_
* }}*
Whenever screen resolution is changed my cards arranged indefinitely?,

You could consider simply using Screen.Height and Screen.Width in the calculations:

You could use ‘Screen.width’ to get the current screen width, then use it to calculate your position of your liking. Could do something like this for example:

for (int i = 0; i < 52; i++) 
{
      if (i % 4 == 0) 
      {
            // b1 _.transform.position = new Vector3 ((400 + 5 * i), 730, 1);_

b1 .transform.position = new Vector3 (((Screen.width/5) + 5 * i), 730, 1);
historySprite = newSprite [pickNo ()];
}
}