The corona of the Sun is dominated by emission from loop-like structures. When observed in X-ray or extreme ultraviolet emission, these million K hot coronal loops show a more or less constant cross section. In this study we show how the interplay of heating, radiative cooling, and heat conduction in an expanding magnetic structure can explain the observed constant cross section. We employ a three-dimensional magnetohydrodynamics (3D MHD) model of the corona. The heating of the coronal plasma is the result of braiding of the magnetic field lines through footpoint motions and subsequent dissipation of the induced currents. From the model we synthesize the coronal emission, which is directly comparable to observations from, e.g., the Atmospheric Imaging Assembly on the Solar Dynamics Observatory (AIA/SDO). We find that the synthesized observation of a coronal loop seen in the 3D data cube does match actually observed loops in count rate and that the cross section is roughly constant, as observed. The magnetic field in the loop is expanding and the plasma density is concentrated in this expanding loop; however, the temperature is not constant perpendicular to the plasma loop. The higher temperature in the upper outer parts of the loop is so high that this part of the loop is outside the contribution function of the respective emission line(s). In effect, the upper part of the plasma loop is not bright and thus the loop actually seen in coronal emission appears to have a constant width. From this we can conclude that the underlying field-line-braiding heating mechanism provides the proper spatial and temporal distribution of the energy input into the corona --- at least on the observable scales.