in reply to Possible to use variable in printf statement?
printf "%-".$width."s ", $AoA[$x][$y]; printf "%-${width}s ", $AoA[$x][$y]; [download]
You can also use "*":
printf "%-*s ", $width, $AoA[$x][$y]; printf "%*s ", -$width, $AoA[$x][$y]; [download]