Cobalt and nickel are elements 27 and 28, respectively, but this wasn't always so. Older textbooks often put cobalt and nickel together because they weren't sure which came first. Though there were chemical reasons to believe that cobalt preceded nickel in the Periodic Table, no matter how carefully they measured it, nickel always came out lighter than cobalt, even though it should be heavier.
Scores of new elements were discovered in the 19th century and back then weight measurements were used to identify them and to place them in the table. T. W. Richards won the Chemistry Nobel in 1914 "in recognition of his exact determinations of the atomic weights of a large number of the chemical elements." But realize that while the Periodic Table originally sorted and arranged chemical elements according to their atomic weights, the table actually sorts the elements according to their atomic numbers. The notion of atomic number was unknown to 19th century chemists.
A hypothetical sample of cobalt, nickel, and copper** ions would give a mass spectrum looking something like this:
Natural cobalt is monoisotopic (59Co), while nickel has five isotopes: 58Ni, 60Ni, 61Ni, 62Ni, and 64Ni, with the lightest being the most abundant. Note how 58Ni precedes 59Co. Why cobalt likes neutrons more than nickel does is an interesting question for which I have no answer.
Henry Moseley first showed that cobalt and nickel were correctly ordered despite their anomalous weights. Around the same time, J.J. Thompson invented mass spectrometry which sorts ions according to mass as shown above. Thompson discovered that neon had two isotopes but the concept of isotopes wasn't fully understood until James Chadwick discovered the neutron in 1932. Chadwick's discovery also enabled the subsequent syntheses of elements beyond uranium.
*Tellurium (element 52) presents a similar weight anomaly because it is on average heavier than iodine (element 53).
**I wrote about copper isotopes back here and included it because it falls close to Ni and Co.