well, what do you mean exact position? exact x,y coordinates or specific positions relative to other dynamically generated tables?
the color thing is easy
handle color switching however you like, switches, elseifs or even array manipulation, example
$colorsarray[]="#392823";
$colorsarray[]="#353453";
$colorsarray[]="#334344";
$colorsarray[]="#365665";
if (!isset($color)) $color=current($colorarray);
elseif (next($colorarray) !== false) $color=current($colorarray);
else {reset($colorarray); $color=current($colorarray);
<table bgcolor="<?PHP echo $color; ?>