Two-dimensional convection in a horizontal fluid layer with spatially periodic boundary temperatures