In porous electrodes for which the pore size is comparable to the size of the electrolyte ions, the thermodynamics is qualitatively different from that in the bulk. We performed Monte Carlo simulation of the primitive model for a range of pore size and voltage in order to study the thermodynamic behaviours in porous electrodes and their relations to the ionic structure in the pores. In particular, we found that the pressure that is exerted in porous electrodes on applying voltage is sensitively dependent on the conditions such as the ion size, the pore size and the applied voltage. The pressure can be positive or negative and the magnitude can be orders of magnitude larger than the atmospheric pressure. The mechanism of volume change of porous electrodes on applying voltage is discussed from a molecular viewpoint.