We investigate the electrodynamics of an outer gap in the meridional plane of the aligned-rotator. The charge depletion from the Goldreich-Julian charge density causes a large electric field along the magnetic field line. The electrons or the positrons are accelerated by the field-aligned electric field and radiate the $gamma$-rays tangentially to the local magnetic field line. Some of such $gamma$-rays collide with $X$-rays to materialize as the electron-positron pairs on different field lines from the field line on which they were emitted. As a result, the electric field structure is expected to change across the field lines. Including these trans-field effects, we solve the formation of the electric field self-consistently with the curvature radiation and the pair creation processes. The $gamma$-ray emission and the pair creation are treated by use of Monte Carlo technique. We demonstrate that the distribution of the electric field along the field lines is affected by both the gap geometry and the external currents coming into the gap through the boundaries. In the electrodynamical model, it has been known that the solution disappears if the current density carried by the electron-positron pairs produced in the gap exceeds a critical value. We show that the critical current density is significantly increased when the trans-field structure is taken into account. We also find that the location of the inner boundary of the gap shifts toward the stellar surface from the conventional null surface as the current density increases. The reason for the shift is derived from the stability condition of the inner boundary. We also argue that the ideal-MHD condition holds outside of the gap only when the low energy particles coexist with the high energy particles migrating from the gap.