Donald Trump eked his way into the White House last fall on the strength of 78,000 votes in three states. He lost the popular vote by about two percentage points, earning the support of just under 46 percent of voters who cast a ballot.

Since Nov. 8, polling has consistently shown that an even smaller percentage of the country thinks the president is doing a good job. The most recent weekly approval rating average from Gallup, for example, has Trump at 39 percent approval — seven percentage points lower than the support he got at the ballot box.

On Monday, Gallup offered a more detailed set of data. Using interviews conducted over Trump’s first six months in office — during which his approval slipped slightly nationally — Gallup determined the average approval in each of the 50 states.

In 17 states Trump’s approval rating was at or above 50 percent. In 31 states, more people disapproved of his job performance than approved.

Unsurprisingly, those states that view Trump positively are also among those that supported him the most during last year’s election. Some states stick out, though: Texas, where Trump is viewed net negatively; and Michigan, Wisconsin and Pennsylvania, the three states that gave him that crucial 78,000-vote margin of victory.

It’s worth noting that in 47 of the states, Trump’s approval rating is now below the percentage of the vote he received. The three exceptions: Hawaii, Utah and Montana.

Those exceptions give a hint of what’s going on. Utah was unusually lukewarm about Trump’s candidacy, compared with other Republican states, and Hawaii was fervently opposed to Trump. The former case was a reversion to the norm; the latter, a nowhere-to-go-but-up situation.

The more important factor here is that Gallup’s approval polling samples all adults, while voting results are, obviously, just those people who went to the polls. In other words, a lot of people dislike Trump who probably won’t go to the polls in 2020.

That said, though, there is a correlation between a president’s approval rating and his reelection prospects. Below, a comparison of Gallup’s November approval ratings with the results of a president’s reelection bid.

A key thing to notice about that chart: The approval rating in November was nearly always higher than the percentage of the vote that the president received. (The dashed line shows where the approval rating and share of vote would be equal. The solid line shows the trend in results.) In one case — President Barack Obama in 2012 — it was equivalent. In all those elections save the two at lower left, the president was reelected.

If Trump were to win only states where he had at least 50 percent approval in the first six months of this year, he’d end up with 99 electoral votes out of the 270 needed to win the presidency. (As we’ve seen so often before, not many people live in the big states Trump won in 2016.) If he won those where he’s at 45 percent or more? He’d snag 154 electoral votes.

In the three states that gave Trump his 78,000-vote electoral college victory, he’s at 43 percent (Pennsylvania and Wisconsin) and 42 percent (Michigan) approval. If he hopes to repeat his victories in those states, Trump will need to see much better numbers in three years’ time.