One of my sons was talking about getting a small inverter gen for storm power outages, because he and his wife and kids couldn't stand being without wi-fi.
So he asked me about the cord idea and would it just power the room.
I told him that I had no idea.
I ain't no electrician!!!!
Here's a few things. Many breaker boxes don't typically use a "row" anymore. They're more commonly a zig zag pattern inside the breaker box most of the time, but if it's an older box, it may be just the row. If it's newer, it's very likely to be zig zag.
What you're referring to is often called a suicide cord. It will feed back to everything that is on that circuit and also power whatever is attached in the breaker box (the row or zig zag that was mentioned earlier), so you need to be mindful of what all you are trying to power. It' doesn't take long for a 16ga extension cord to get too hot and melt/burn if too much stuff is on it.
I used 12ga romex to go from the generator to the small panel. And as I mentioned, I don't have a lot of stuff on the generator either. Certainly no 220v stuff like oven and furnace and dryer and stuff.
I wired my box a little differently when we did a major remodel a few years ago. My house is old and has a 100A service breaker box. Yeah, I know it should probably be twice as big, but it's worked for the last 70 years so I'm not mucking with it.
With that said, when we added the addition onto the house, I got a small 8 breaker panel and moved everything that I wanted to run off the generator, so I can knock the 50A double pole breaker that would normally feed over into the small box. This prevents the power from feeding back into the 100A main. And back through your transformer and back out onto the line. But I do also knock my main breaker as well as a failsafe.
The major things that I moved over to the small panel were all the interior lights, the fridge and deep freezer, a couple of outlets in the kitchen and living room wall (those few outlets are on the same circuit because they're in the same load bearing wall). My generator is small (1500w) but it will keep up with the fridge and deep freezer and a few lights and a tv/dvd player for the grandkids if they want to watch a movie or play their game or something.
Now, with all of that said I want to bring this to their attention. Where your wifi router is concerned, unless the company that is providing internet has battery backup power supplies in the system to get the internet to you, it's either going to be out, or will very likely be out as soon as the battery backups are drained when the power is out for a prolonged period because throughout the catv and phone system, they have to power it so the amplifiers and other things work and when it's out, so is their service, so unless it's powered from somewhere else from where your home is getting its' electricity, the internet is going to probably be out anyway with or without a generator. I just wanted to throw that out there. You'd need to ask your internet provider that question. Most any service tech can answer that in a few minutes if they're familiar with the system where you live.
It is generally safer to run an extension cord from the generator to one of those multiple outlet surge protector things when you can. But it is more convenient if you can just power a few breakers in a box, as Ernst mentioned, IF it's not overloaded and it's done right.