President Trump speaks to the press before departing the White House. (Carolyn Van Houten/The Washington Post)

Donald Trump learned a powerful lesson while running for president.

The rules don't apply to me. Trump blew through one political stop sign after another as he sped recklessly past the competition; again and again, he burned rubber away from the feckless, doughnut- ­munching cops of the media, the swamp and academia. The rule about not calling Mexican immigrants "rapists" in your announcement speech? The rule about not attacking a war hero or a Gold Star family? The rule about releasing your tax returns, and the one about never, ever boasting of sexual assault while wearing a live microphone?

Trump squealed his tires and waved a one-finger salute.

But it appears the lesson was mistaken, for the long arm of political law is catching up to the president. That's one of my takeaways from the special U.S. Senate election this last week in Alabama, where hogs sprouted wings, rivers ran backward and a Democrat won. Trump believed he could get away with flouting the political commandment that says Thou Shalt Not Endorse Accused Child Molesters. He thought his cloak of immunity was large enough to enfold Roy Moore, with room for Stephen K. Bannon left over.

The margin of victory for Democrat Doug Jones was — like Trump's own victory last year — small in terms of ballots but huge in its implications. The last time that Senate seat was before the voters, the Republican ran unopposed and won 97 percent of the ballots. Last year, Trump beat Hillary Clinton in Alabama by almost 2 to 1. But when the president tried to hoist Moore into office, he found he had lost his pull. He tried tweeting; he tried rallying; he even bestowed his personal benediction on Moore. "He says it didn't happen," Trump observed in dismissing multiple accounts of sexual impropriety. The very same standard to which Trump holds himself.

It didn't work.

You'd think a billionaire would know what every investment prospectus preaches: Past performance does not guarantee future results. And you'd think a TV star would understand the need to add layers and complexity to a protagonist over the course of a long-running series. Yet Trump persists in his one-dimensional role: rebel without a pause button.

A fascinating — and, for patriotic citizens, dispiriting — account of life inside the Trump White House by the New York Times recently disclosed that the amped-up monotony of this presidency is entirely intentional. From the start, Trump conceived of this drama as a relentless serial. "Before taking office, Mr. Trump told top aides to think of each presidential day as an episode in a television show in which he vanquishes rivals."

However, he forgot to make the audience root for the star. In Trump's confrontations with multiple women who allege that he sexually harassed or assaulted them, most Americans are with the women, according to Rasmussen. In Trump's rivalry with special counsel Robert S. Mueller III, a majority of Americans back Mueller, according to a Post-ABC poll. Overall, Trump's Gallup approval rating has not been above 40 percent since early summer and lately has been hovering in the mid-30s.

If his presidency were truly a TV drama, it would be canceled.

Or it would be relegated to a niche cable channel or streamed on YouTube for an especially grumpy, iconoclastic audience. And this is exactly the problem. Trump and his so-called strategist Bannon (after the Moore debacle, Trump may finally stop taking his calls) appear to have learned their politics from cable and the Internet. Conduits such as Bannon's Breitbart and the Sean Hannity show can be very powerful in a partisan primary, but their business model involves pandering to a minority. They don't need a big audience as long as they mesmerize a small one.

A successful president, on the other hand, must have a large part of the country willing to lend an ear and show support. With only about a third of the public behind him — and always the same third — Trump is increasingly weighed down by his offenses, no longer soaring free of them. Though he is almost certain to get a tax bill to crow about, he lacked enough juice to get the funding mechanism for a big infrastructure package he has promised to deliver next year.

The loss of a Senate seat may well put the brakes on his judicial juggernaut, with moderate Republicans now controlling enough votes to block right-wing nominees. Last year's dreams of a filibuster-proof Republican Senate majority have turned to the possible nightmare of an impeachment-minded Democratic majority in the House in 2019.

Of all the laws in all the books, perhaps the most stubborn are the laws of math and physics. Trump has tried to transform politics from a game of addition to a game of division, but math is catching up with him. And the law of gravity is taking hold.

Read more from David Von Drehle's archive.