Make sure the dishwasher is centered between the two cabinets. Measure the space on each side between the dishwasher edges and the cabinets.
Purchase filler strips at a home improvement store that are wide enough to cover the space. Choose a wood stain that best matches the color of your cabinets.
Cut the filler strips so they are the same height as the cabinet front. Don't include the toe kick of the cabinets in your measurements.
Stain the filler strips and let them dry completely, about 24 hours. Screw L-brackets to the top and bottom of each filler strip, using 1/2-inch wood screws.
Unscrew the anchor screws from the dishwasher that secure it to the counter top. Pull the dishwasher out of the space so you can access the walls around it.
Screw the L-brackets on each filler strip into the wood of the cabinet inside the dishwasher space. The filler strips should rest securely between the cabinet edge and where the dishwasher will fit.
Push the dishwasher into place and center it so the filler strips just touch the edges. Screw the anchor screws back into place under the counter top.