The explanation of lattice energy is explained below:
As we move from left to right across the period, the lattice energy increases.
Because the electrons are added in the same shell and the protons in the nucleus attract those electrons more tightly. As a result, the atomic radius of the compound decreases and lattice energy increases
Again moving from left to right across the period, the charge in the ion decreases as because the loss of electrons takes place and protons in the nucleus pull those remaining electrons more tightly. Therefore, lattice energy decreases.
The diagram shows the trend of lattice energy across period
Hence, the above points explain the lattice energy across a period.