In this paper, all elementary particles (leptons, quarks, gauge bosons, and the Higgs boson) can be placed in the periodic table of elementary particles based on string theory with oscillating spacetime dimension number, instead of conventional string theory with fixed space-time dimension number. Dimension number oscillates between 11D and 10D and between 10D and 4D reversibly. The oscillation of space-time dimension number (D) is accompanied by mass dimension number (d) to represent mass. Space-time dimension number decreases with increasing mass dimension number, decreasing speed of light and increasing rest mass. 4D particle originally is 4D10d particle, and has the lowest speed of light and the highest rest mass. With the same energy, the relation between adjacent mass dimensions is Md-1=Mdαd2, where M is rest mass, d is mass dimension number, and α is the fine structure constant. According to the proposed cosmology, the non-gravitational 4D10d particles were sliced into 4D4d core particles surrounded by 6 separated mass dimensions as the 6 dimensional orbitals constituting the non-gravitational forces (electromagnetism, strong, and weak). The combination of the 6 dimensional orbitals and the gravitational 4D10d particle resulted in the 7 dimensional orbitals. As the periodic table of elements based on the atomic orbitals, the periodic table of elementary particles is based on the combination of the two asymmetrical sets of the 7 dimensional orbitals. One set as the principal dimensional orbitals is mainly for leptons and gauge bosons, and another set as the auxiliary orbitals is mainly for individual quarks. The calculated constituent masses of leptons, quarks, gauge bosons, and the Higgs boson are in good agreement with the observed values. For examples, the calculated mass of top quark is 176.5 GeV in good agreement with the observed 173.34 GeV, and the calculated average mass of the Higgs boson is 128.8 GeV in good agreements with the observed 125 or 126 GeV.