Calculate the desired height of the headboard. If it is purely decorative, it can be any height, but typically not less than 12 inches. If someone is going to lean on the headboard, measure from 2 inches above their head to the top of the mattress and use this as the measurement for the headboard height.
Measure the width of the mattress -- a twin bed is 37 or 39 inches wide. Cut a piece of 1/2-inch plywood to the same width as the bed and the chosen headboard height.
Cut a piece of 1- or 2-inch thick foam the same measurements plus 1/2 inch on all sides. Cut a piece of bonded terylene batting the same measurements plus 3 inches on all sides. Cut the fabric the same measurements plus 5 inches on all sides.
Place the terylene on the table and center the foam on the terylyne. Spray one side of the plywood with foam adhesive and center it on the foam. Apply pressure all around the plywood to ensure a solid bond.
Wrap the terylene over the foam, up toward the plywood, and staple into the 1/2-inch wide cut edge of the plywood. Wrap and staple all around the perimeter of the plywood. Trim the excess terylyne to the edge of the plywood.
Lay the fabric on the table, wrong side up and center the terylene side of headboard on the fabric. Wrap the fabric up and over the edges of the covered terylyne, toward the plywood and staple to the back of the plywood, 1 inch in from the edge. Staple at the center of one edge of the headboard, then on the opposite side of the headboard at the center point, ensuring that the fabric is taut. Staple at the center of each of the remaining two sides.
Continue stapling each side, from the center out to each corner, keeping the fabric taut and smooth. At each corner fold the fabric, just like a "hospital corner” on a bed, and staple in place. Trim the excess fabric.