When the vertical boundaries of a container of stratified brine solution are heated, cells are observed to form in the brine with a layered structure. An explanation of this phenomenon has been given in terms of the successive growth of cells from the top and bottom of the container. An alternative explanation is given here which is based on an examination of the stability of the fluid layer in the neighbourhood of the vertical boundaries, a layer in which there exist horizontal gradients in both temperature and salinity, and the explanation is subjected to comparison with a carefully controlled laboratory experiment. The theoretical description is fairly general and it seems possible that the effects of horizontal gradients of salinity and temperature, which approximately compensate each other so as to leave no horizontal density gradient, may be important in the ocean, as suggested by Stern (1967).