The structural properties and the phase transition between the B1 (rock salt) and B2 (CsCl) phases of NaCl have been investigated at an ab initio level. Total energy curves, obtained with periodic Hartree-Fock (HF) calculations, have been corrected a posteriori by integrating the HF charge density according to the correlation-only density-functional-like formulae proposed by Colle and Salvetti in 1975 and by Perdew in 1986 and 1991. The three functionals are 'non-local', containing terms that depend on the gradient of the electronic density. The correlation correction brings the HF data for the lattice energy (LE), lattice parameter (ao) and bulk modulus (B) into good agreement with experiment, the best performance being obtained with the most recent functional, (the percentage error is +0.3%, -0.5% and +5.6% respectively for LE, ao and B).