A sofa table is the long, narrow table that stands behind a sofa, usually one floated in the room with its back to a walkway or the dining end. From the seats it is out of sight. From behind and from the side it is in full view, and it is seen against one line, the top of the sofa back.
Set the tabletop level with that line or an inch or two below it. For most sofas that means a table 28 to 32 inches high, about 10 to 14 inches deep, and no longer than the sofa.
Measure the Back, Then Set the Height

Measure from the floor to the highest point of the sofa back, in the middle of the sofa, with the back cushions in place as they are when people sit. Loose back cushions often rise above the frame, so measure the cushions, not the frame behind them.
A tabletop level with that height makes one continuous line with the sofa from the side, and one an inch or two lower tucks just under it, so the sofa back is the edge the eye follows. For example, a sofa with a back 31 inches high takes a table 29 to 31 inches tall. A table taller than the back tends to stand up behind the sofa like a second piece of furniture competing with it, and objects on it are in the way of anyone leaning back.
Low Backs and Tall Ones

A low-backed sofa, with a back around 26 to 28 inches, is lower than most sofa tables sold, which run 30 to 32 inches. Behind it, a low console or a long bench at the height of the back keeps the line. A standard table would rise several inches above the back and look perched.
A tall sofa, with a back of 34 to 36 inches, takes a table to match, a height closer to a hall console. A counter-height table at about 36 inches behind a sofa is a different piece, a place to stand or perch on stools with a drink, and it is chosen for that use, not for the line.
Length and Depth

Keep the table shorter than the sofa, with its ends inside the arms, so it belongs to the sofa and doesn’t stretch past it. Two thirds to three quarters of the sofa’s length is a common range, and the full length between the arms is the upper limit.
A depth of 10 to 14 inches holds a lamp, a tray, and a few things put down on the way past. Deeper than that, it eats into the walkway and starts to look like a desk.
Room Behind It

Set the table close to the back of the sofa, about an inch away, so nothing falls into the gap. Behind the table, where it backs onto a route through the room, leave about 30 to 36 inches of clear floor, enough to walk past without turning sideways.
A sofa pulled off the wall needs that path planned as part of the layout, since the table takes about a foot of it.
A Lamp on Top
A sofa table is often where a living room’s second lamp goes, lighting the room behind the sofa and the back of the seats. A lamp about 26 to 34 inches tall suits a table at this height, with a shade narrower than the tabletop’s depth so it doesn’t hang over the edge. One lamp near one end leaves space for a tray or a bowl at the other.