Small-angle x-ray scattering was used to investigate the nanostructures of complexes formed by interactions of ionic surfactants with oppositely charged polyelectrolyte gels at room temperature (similar to 23 degrees C). Highly ordered supramolecular structures of Pm3n space group cubic, face-centered cubic close packing of spheres, hexagonal close packing of spheres, hexagonal close packing of cylinders, bilayer lamellar, and Ia3d space group cubic were, respectively, determined under different experimental conditions. The structural elements of spheres and/or rods were shown to be spherical and/or cylindrical micelles formed by the self-assembly of ionic surfactants driven by both electrostatic and hydrophobic interactions of the charged copolymer chains/surfactants and of the surfactants/surfactants inside the polyelectrolyte gel matrix. The charge density, the chain flexibility and the crosslinker density of the polyelectrolyte gel network chains, and the properties of the ionic surfactants had significant effects on the shape, the aggregation number, and the size of the formed micelles, thus determined the type and the order of the packed structures of those complexes.