Planetary formation theories and, more specifically, migration models predict that planets can be captured in mean-motion resonances (MMRs) during the disc phase. The distribution of period ratios between adjacent planets shows an accumulation in the vicinity of the resonance, which is not centred on the nominal resonance but instead presents an offset slightly exterior to it. Here, we extend on previous works by thoroughly exploring the effect of different disc and planet parameters on the resonance offset during the disc migration phase. The dynamical study is carried out for several first-order MMRs and for both low-mass Earth-like planets undergoing type-I migration and giant planets evolving under type-II migration. We find that the offset varies with time during the migration of the two-planet system along the apsidal corotation resonance family. The departure from the nominal resonance increases for higher planetary masses and stronger eccentricity damping. In the Earth to super-Earth regime, we find offset values in agreement with the observations when using a sophisticated modelling for the planet-disc interactions, where the damping time-scale depends on the eccentricity. This dependence causes a feedback that induces an increase of the resonance offsets. Regarding giant planets, the offsets of detected planet pairs are well reproduced with a classical K-factor prescription for the planet-disc interactions when the eccentricity damping rate remains low to moderate. In both regimes, eccentricities are in agreement with the observations too. As a result, planet-disc interactions provide a generic channel to generate the offsets found in the observations.