There have been 10 mass school shootings since Columbine High School. Here's how presidents have responded. (Joyce Koh/The Washington Post)

As he heads to Florida this weekend, President Trump is following in the footsteps of former president Barack Obama, a man he disparages and a leader whose time in office in many ways came to be defined by mass shootings.

Obama bequeathed on his successor an almost ritualistic response to gun tragedies, beginning with the 2011 attack on then-Rep. Gabrielle Giffords (D-Ariz.) and ending with the 2016 Dallas attack that left five officers dead. There were 15 speeches from the White House, countless prayers for the fallen and more than a dozen visits to the crime scenes.

All the while, Obama traveled a path from empathy and promises of action to anger and, ultimately, defeat. “I am not naive,” Obama said in Dallas. “I have seen how inadequate my own words have been.”

Trump, beginning the second year of his presidency with his third major mass shooting, has a different problem. His challenges when it comes to connecting with a grieving public are often both personal and political.

While Obama simply ran out of things to say about the nation’s unending string of gun tragedies, Trump — who often strains to express empathy — has struggled to find much to say about them at all.

President Barack Obama speaks at a vigil on Dec. 16, 2012, after the massacre at Sandy Hook Elementary School in Newtown, Conn. (Olivier Douliery/via Bloomberg News)

In a statement from the White House on Thursday morning about the deadly school shooting in Parkland, Fla., Trump promised to work with state and local leaders to “tackle the difficult issue of mental health.”

But his remarks, which lasted about six minutes, were so generic that they could have applied to any catastrophe.

“To every parent, teacher and child who is hurting so badly, we are here for you, whatever you need, whatever we can do to ease your pain,” he said, reading from a script in a practiced monotone in the Diplomatic Room of the White House. “We are all joined together as one American family, and your suffering is our burden also.”

The comments mirrored what he said in September after the devastation caused by Hurricane Harvey in Texas and Louisiana.

“When one American suffers — and I say this quite a bit, especially lately, when you see what’s going on — we all suffer,” Trump said in the storm’s aftermath. “We’re one American family brought together in times of tragedy by the unbreakable bonds of love and loyalty that we have for one another.

And they struck a discordant tone with his presidency so far. His call to “answer hate with love” and “cruelty with kindness” came from a president who responds to criticism by punching back “10 times harder,” as his wife once said, and who takes pride in demeaning rivals with insulting nicknames.

President Trump speaks at the Las Vegas Metropolitan Police Department in the wake of the October mass shooting that killed more than 50 people. (Kevin Lamarque/Reuters)

Trump’s most genuine emotion — the one that attracted legions of followers to his presidential campaign — is his anger, aides say.

“We got elected on ‘Drain the Swamp,’ ‘Lock Her Up,’ ‘Build a Wall,’ ” Stephen K. Bannon, Trump’s former chief strategist, said in a recent interview. “Anger and fear is what gets people to the polls.”

But anger has seemed off-limits for Trump when it comes to the root causes of mass shootings and the unwillingness to act in Washington. Polls suggest widespread support for gun-control legislation, but Trump has remained loyal to supporters who believed that Obama was trying to take away their guns. Instead, he has repeatedly pointed to mental illness as the cause of mass killings, including the one in Florida, though his administration has moved to cut spending on such care.

For presidents, the hours and days after mass shootings can be clarifying — exposing both their strengths and weaknesses as leaders. Some of Obama’s most memorable, moving and eloquent moments came in the wake of such tragedies.

“We can’t tolerate this anymore,” Obama said at an evening prayer vigil after the killings of 20 children and six adults at Sandy Hook Elementary School in Newtown, Conn. “These tragedies must end.”

Following the slaughter of nine parishioners at Emanuel AME Church in Charleston, S.C., Obama led an arena full of mourners in “Amazing Grace.”

But he was never able to mobilize Congress or the country to action — despite the vast public support for gun-control legislation.

“Every time I think about those kids, it gets me mad,” Obama said in 2016, with tears rolling down his face, as he recalled the Newtown massacre while surrounded by victims of mass shootings at the White House.

On the campaign trail, Trump had a unique ability to connect with voters, presenting himself as someone who understood their problems and was fighting for them. Those connections have been tougher for him to forge as president — especially on issues such as gun control where he is out of step with most of the country.

Rather than offer policy solutions, Trump has stuck with general expressions of sadness following mass shootings.

On Thursday, he promised to visit Parkland to “meet with families and local officials and to continue coordinating the federal response.” Trump could make such a visit this weekend, when he is slated to stay at his Mar-a-Lago resort in Palm Beach, Fla.

Later this month, Trump said, he will meet with the country’s governors and attorneys general to discuss mental health and making schools “safer.”

“It is not enough to simply take actions that make us feel like we are making a difference,” Trump said. “We must actually make that difference.”

Trump followed a nearly identical routine in early October after the largest mass shooting in modern U.S. history, which left more than 50 dead at an outdoor country music festival in Las Vegas. After that tragedy, there were calls for Congress to outlaw “bump stocks,” a device used by the shooter in Las Vegas to turn an assault rifle into a rapidly firing machine gun. But Trump chose not to take a position on the issue.

“The president’s a strong supporter of the Second Amendment,” White House press secretary Sarah Huckabee Sanders said at the time. “That hasn’t changed.”

One month later, after a gunman opened fire in a rural Texas church, killing 26, Trump issued a brief statement urging Americans to “pull together . . . join hands . . . lock arms . . . stand strong.” Trump, who was visiting Asia at the time of the tragedy, sent his vice president to the scene.

The big question for Trump is whether he will pay a political price for inaction in the wake of gun tragedies. Obama’s experience suggests that he will not.

In seven years, Obama attended memorial services in Tucson; Newtown; Aurora, Colo.; the Washington Navy Yard; Charleston; and Dallas. By the time of that last visit, Obama had begun to question whether any of the speeches, calls to action and expressions of grief had changed the way anyone looked at the problem.

In the aftermath of this week’s shooting, Obama — lacking the bully pulpit of the presidency — communicated via Twitter. “We are grieving with Parkland,’ ” he tweeted on Thursday. “But we are not powerless.”

Trump seems well aware of Obama’s history and has shown almost no interest in pushing new policies on guns and mental health.

In the first hours after Wednesday’s school shooting, White House officials were scrambling to get more information and figure out how to respond.

Longer term, the president seemed to be making a different calculation. In his remarks, he spoke of the need for Americans “to work together to create a culture in our country that embraces the dignity of life, that creates deep and meaningful human connections, and that turns classmates and colleagues into friends and neighbors.”

By not setting concrete goals, Trump seemed to be betting that he can avoid a legislative failure like Obama’s.

Eventually, he seemed to be wagering, Americans will move on to other issues. Eventually, they will forget.