The confinement of Ar in planar slits of two identical parallel semi-infinite walls of alkali metals, alkaline-earth metal Mg, and CO(2) is investigated within the framework of the density functional theory. It is assumed that (1) the fluid atoms interact via a recently proposed effective attractive pair potential with strength, epsilon(ff), which reproduces the experimental data of the surface tension of the liquid-vapor interface at the bulk coexistence curve, and (2) the adsorption on the walls is described by ab initio potentials characterized by a well depth, W(sf). In this way the systems were studied in the framework of a realistic approach. We found that for small coverages, the slit is always filled by forming two symmetric vapor films, one at each wall. For increasing coverage the behavior depends on the ratio W(sf)/epsilon(ff) and the temperature T. In the case of alkali metals, we found at the triple point, T(t), of the adsorbate a regime of average density rho(av) ( *) in which the ground state exhibits asymmetric density profiles, leading to the so-called spontaneous symmetry breaking (SSB) effect. The SSB appears at an average density rho(sb1) ( *) and disappears at a higher average density rho(sb2) ( *). When T is increased, the range of densities rho(sb1) ( *)<or=rho(av) ( *)<or=rho(sb2) ( *) diminishes and eventually the SSB disappears at a critical temperature, T(sb), which coincides with the critical prewetting temperature T(cpw) observed in the adsorption on a single wall. For T>T(cpw) the slit is filled symmetrically up to the phase transition to capillary condensation. All these features are examined as a function of the strength of the substrate and the width of the slit. Furthermore, no SSB effect was found for Mg and CO(2).