# Dynamic layout formula

**URL:** <https://forum.kirupa.com/t/dynamic-layout-formula/115859>\
**Category:** Uncategorized\
**Created:** [July 12, 2004, 3:05pm UTC](https://forum.kirupa.com/t/dynamic-layout-formula/115859 "2004-07-12T15:05:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fumeng](https://avatars.discourse-cdn.com/v4/letter/f/a9adbd/32.png) [@fumeng](https://forum.kirupa.com/u/fumeng)\
**Post date:** [July 12, 2004, 3:05pm UTC](https://forum.kirupa.com/t/dynamic-layout-formula/115859/1 "2004-07-12T15:05:34Z")

</div>

hi. i’m trying to dynamically layout a calendar using actionscript and i’m no good at determining algorithms to quickly and efficiently lay things out. i was hoping for a little help with this one, please.

what i want to do is set it up per the image attached:

- where there are 7 columns and a varying number of rows.

- the top row has the 2 arrows and the month and year display.

- the second row has all the day headings, i.e. S, M, T, W, R, F, S

- and the rest of the rows will have the dates.

how do i come up with a nice clean formula to calculate the positions so all these elements align??

thanks. fumeng.
