calculate tablepcwidth more carefully