Choose a Spot for the Switch
The first thing you'll need to do is decide where you want to secure the switch on the length of the cord. If a portion of the cord rests on the table near the base of the lamp, securing the switch in this area will make for an easy reach.
Once you've located the point where you'll position the switch, place your screwdriver and utility knife (Image 1) within reach, then use the screwdriver to separate the two halves of the switch (Image 2).
Make the First Cut
Unplug the lamp and examine the plug. If both prongs of the plug are the same size, you'll be able to cut the wire on either side of the cord to install the switch. If one prong is larger than the other, however, this indicates a polarized plug. To add a switch on a cord with a polarized plug, you'll need to cut the wire on the side of the cord opposite the larger prong. In this demonstration, the white plug is standard, the brown is polarized (Image 1).
Once you've determined which side of the cord you'll need to cut -- or if either side can be cut -- you're ready to use your utility knife. Begin by making about a 5/8" slit in the center of the cord, between the two wires (Image 2), taking care not to damage the insulation.
Next, pull the wires of the cord apart to create a diamond/marquis-like shape (Image 3).
Make a Second Cut
Then cut the non-polarized wire (or either of the wires if your cord's plug is non-polarized) at the center point of the divided sections.
Make a second cut about 1/8" away from first cut to remove the small center piece.
Install and Test the Switch
Now you're ready to install the switch -- fit it into the hollow section, with one wire around each side of the center piece (inside), 1 cut, 1 uncut (Image 1).
Replace the top pieces of the switch; hold it firmly in place while repositioning the nut on the back side of the switch. Tighten the screw to hold the nut in place (Image 2), then test the switch.