You need to pass a parameter string to Paypal. They will give you the format. You will need to use javascript to code this dynamically - I am afraid it isn't something for the faint hearted.
As an alternative check out shopping cart software which handles a lot of this for you.