The isotope effects in x-ray absorption spectra of liquid water are studied by a many-body approach within electron-hole excitation theory. The molecular structures of both light and heavy water are modeled by path-integral molecular dynamics based on the advanced deep-learning technique. The neural network is trained on ab initio data obtained with SCAN density functional theory. The experimentally observed isotope effect in x-ray absorption spectra is reproduced semiquantitatively in theory. Compared to the spectrum in normal water, the blueshifted and less pronounced pre- and main-edge in heavy water reflect that the heavy water is more structured at short- and intermediate-range of the hydrogen-bond network. In contrast, the isotope effect on the spectrum is negligible at post-edge, which is consistent with the identical long-range ordering in both liquids as observed in the diffraction experiment.