The elaborate event seemed like the kind of celebration President Trump might host in the coronavirus era: about a dozen circular tables with purple and pink flowers brimming from gold vases, arranged in a grand but windowless room.

But this was no Trump affair. It was a setup for a dinner to be hosted by House Speaker Nancy Pelosi.

“It’s very spaced,” the California Democrat assured reporters, arguing Friday evening that the post-election reception she was about to host for just under 50 incoming and reelected members was socially distanced and approved by the House physician.

A few hours later, amid a furious backlash on social media — including from people who questioned why they were not allowed to bury their dead while lawmakers attended fancy parties — Pelosi canceled the dinner, turning it into a takeout meal instead.

It was the latest in a series of moves by the speaker, who has routinely knocked Republicans for acting irresponsibly during the pandemic, that have played into the hands of critics who see a double standard.

For the first 10 months of the pandemic, Pelosi rejected calls to institute regular virus testing for lawmakers who fly back and forth across the country, though so too did her GOP Senate counterparts. And early on, she was recorded on camera getting her hair done at a San Francisco salon despite a local prohibition on such services.

The furor over Friday’s dinner is spotlighting a conundrum facing the Democratic Party as infections are again soaring: With Joe Biden capturing the White House and many party leaders advocating tough restrictions, Democrats will have to be careful not to appear hypocritical — especially as Americans are urged to sharply limit their Thanksgiving gatherings.

“We’ve seen a lot of double standards,” Rep. Mike Johnson (R-La.) said. “They impose these draconian restrictions and then they go and violate their own regulations. I can tell you what the people back home think about it in Louisiana — I mean, they were very frustrated about what they see to be a double standard and they see political leaders saying one thing and then not practicing it.”

Still, Pelosi and the Democrats have been far more mindful of coronavirus restrictions than Trump and the GOP. Unlike the outgoing president, the speaker has always worn a mask in public, while Trump mocked those who followed doctors’ orders and covered their faces.

Trump spent much of the fall flying around the country, attending campaign rallies and hosting White House events — eventually contracting the virus himself following a Rose Garden celebration for then-Supreme Court nominee Amy Coney Barrett, which became an apparent superspreader event.

Over the weekend, while Pelosi canceled her reception, House Minority Leader Kevin McCarthy (R-Calif.) went ahead with his own version of a new members’ welcome, hosting about 90 lawmakers in one room for a short happy hour on the second floor of the Capitol.

But unlike her GOP counterparts, Pelosi has portrayed herself and her Democratic colleagues as model citizens in this year of crisis. She has dubbed Democrats “the party of science,” hitting Republicans all year for acting irresponsibly and ignoring doctors’ recommended precautions.

Pelosi struck that note again at midmorning Friday, rapping Trump and the GOP at a news conference for failing to “listen to science” and arguing that separation and isolation would help “crush the virus.” That was about seven hours before the dinner was scheduled.

Rep. David N. Cicilline (D-R.I.) said switching to takeout was the right move and that such decisions are not always easy.

“I think members are trying to navigate this, the work in Congress and the welcoming of new members of Congress . . . just like people are trying to figure out how to have certain important events in their lives,” Cicilline said. “This is all new for everyone.”

But the dinner initially threatened to provide the sort of split-screen image that has prompted critics to complain that elite leaders flout the difficult restrictions they impose on the public. And it wasn’t the first time it had happened to Pelosi.

The speaker caught flak earlier in the fall when she got a private hair blowout in a salon despite a moratorium on those types of services. Pelosi said that she did not know the activities were prohibited and that she had been set up by the salon’s owner.

She also has regularly traveled across the continent on commercial flights when federal officials have discouraged the public from doing so, though her office says there is no other choice. And until this week, she declined to accept offers from military officials who have repeatedly offered coronavirus testing for lawmakers traveling to and from their districts, despite her mantra of “testing, testing, testing.”

Pelosi’s defenders have argued that she has followed the House physician’s advice on everything, including Friday’s dinner. That event was slated to be socially distanced, her office said — four people to a 10-person round table, for a total of fewer than 50 attendees. The architect of the Capitol has also installed a new air filtration system to keep people safe, they said, following guidelines from the Centers for Disease Control and Prevention.

But after an NBC reporter tweeted a photo of the tables being set up for the celebratory gathering, the criticism kept piling up on social media as well as on Capitol Hill. Party leaders eventually instructed incoming freshmen to simply grab a boxed dinner and head back to their offices.

“Our office strictly follows the guidance of the Office of Attending Physician, including for this dinner,” Pelosi spokesman Drew Hammill tweeted amid the backlash. “To be a further model for the nation, this event has been modified to allow Members-elect to pick up their meals to go in a socially-distanced manner.”

Hammill noted that the offices of the Capitol architect and the House’s attending physician oversaw the lying in state of the late Justice Ruth Bader Ginsburg and civil rights icon John Lewis. Both events were held during the pandemic, and neither resulted in any known covid-19 cases, Hammill said.

Still, the issue has been a sensitive one for House Democrats, who are loath to criticize the speaker publicly — even while many privately complain. Asked about the optics of Friday’s incident, Rep. Hakeem Jeffries of New York, the fifth-ranking House Democrat, walked away briskly. “You know I’ve got no comment on that — a big ‘no comment,’ ” he said.

Rep. Jim McGovern (D-Mass.) added that “I don’t know enough about that” to comment. “I’m not invited to any dinner,” he said.

Pelosi is not the only Democrat to run afoul of coronavirus restrictions. California Gov. Gavin Newsom has expressed regret for attending a birthday party on Nov. 6 with a small group of friends at the exclusive French Laundry restaurant.

Beyond that, Pelosi’s allies argue that it is unfair to criticize the speaker when the GOP has done far worse all year. Republicans have consistently gathered in closed spaces while Democrats have moved to phone, virtual and outdoor events.

On Capitol Hill, many House Republicans have shown up to committee hearings without masks. That prompted a frustrated Pelosi over the summer to require masks in public areas, while also arranging for committee hearings to be held remotely and allowing proxy voting on the House floor.

This week, House Republicans are planning to hold their leadership elections in person, while Democrats will vote for their leaders electronically. In the Senate, Republicans still routinely gather for their weekly lunches in the Capitol.

On Sunday, following the Pelosi backlash, House Republicans did cancel a full plated dinner they were planning for GOP freshmen. But they still wined and dined their newest colleagues in an abbreviated happy hour that seated two attendees each at 45 mini-tables — a gathering that Pelosi allies noted was twice as large as her would-be dinner.

The Republicans’ guest of honor: South Dakota Gov. Kristi L. Noem (R), a former House member whose state is experiencing the nation’s second-worst outbreak. Noem was seated front and center with her husband.

Republicans, many of whom have appeared repeatedly in public without facial protections, have also had more infections than Democrats: Since April 1, 19 congressional Republicans have tested positive, with Rep. Tim Walberg becoming the latest. Eight Democrats have announced positive tests, according to a recent NPR tally.

The latest controversy comes as Republicans and Democrats continue to argue over the shape of another coronavirus relief bill to help those who have suffered economically from the pandemic.

Pelosi has lambasted the GOP for refusing to back a $2.2 trillion proposal she said would help ordinary Americans, while Republican lawmakers insist a smaller, more targeted package makes more sense. Biden on Monday urged Congress to pass some version of Pelosi’s proposal, though even some House Democrats complain that she has played hardball too long in the negotiations.

Friday’s back-and-forth also shined a light on the little-known House attending physician whom Pelosi has repeatedly cited in justifying what some consider questionable coronavirus decisions. Beyond Friday’s dinner, Brian Monahan initially agreed with Pelosi’s plan not to institute testing for members crisscrossing the country before they voted on the House floor.

Monahan’s office did not respond to a request for comment.

Paul Kane contributed to this report.