Structure and dynamics of magnetic loops in the solar corona