You don't. It's not supposed to be straight. The middle of the net should be 26 millimetres (about an inch) lower than the side, according to the official rules of badminton.
Depending on if your posts (pole?) planted into the gym floor, or are counter-weighted, you may or may not use the rachet mechanism to tighten the net cord. I do not tie any knots as they are not necessary. Use a good quality poly-pro quarter-inch cord. In case you do not have a ratcheted post, use the clove-hitch on this too. Pull the post inward, tie, then pull the post back. This technique should help you adjust height at centre as required. Tie a clove hitch to secure the end opposite of the ratcheted post. When tied, the cord must exactly at 5 feet 1 inch from the gym floor. The other end you loop into the ratchet and spin away until you hear the twang in the net cord like a piano wire. Well, not that tight, but enough so that the middle is an inch lower than the posts (as written by alexh in post #4). Then secure the net tape to the post using a thin cord through the grommets at both ends. When this is done, you may now bring the net together as close to the posts without actually pulling on it. There is usually a white or red-brown cord every few inches down the side of the net, or in lieu of which, you may use broken string, or tape, anything that will secure the net without being noticeable. NB: Pulling net down sometimes reduces the 5 foot height required at the centre. Ideally, the posts should be vertically aligned with the outside lines, and there should be no gaps between the posts and the net.