They certainly did have kids in cities: you think people living in European cities in the 1700s or 1800s somehow all managed to stay childfree? They didn't have birth control back then, nor did they have transportation allowing them to commute.
They had much less children than the people outside cities, and the absolute majority of people was not living in cities then. Many of those working in cities had their families outside the city.