Calculate "perfect" table column widths in PHP