The masses on the periodic table aren’t whole numbers because they are the average masses of each of the element’s natural isotopes. Basically, the number comes from multiplying each isotope’s mass with its natural abundance (a percentage) and then adding each of those numbers up.