The role of three-dimensional (3D) flow structures in an electromagnetically generated array of vortices in a single shallow (electrolytic) fluid layer with and without a vertical no-slip wall has been investigated by Stereoscopic Particle Image Velocimetry. This array of vortices is a result of a continuous, however, time-dependent periodic forcing. Additionally, the dispersion of passive tracers by this linear array of vortices is explored with 3D numerical simulations. As the parameter regime is quite extensive (fluid layer depth, current density, forcing frequency, etc.) we have restricted this study to two specific cases with a fixed fluid-layer depth: the quasi-two-dimensional (quasi-2D) laminar regime (low current density, or weak forcing) and a regime with substantial 3D secondary flows (high current density, or strong forcing). In all cases the forcing frequency is taken similar to the typical eddy turnover time of the quasi-2D vortices. The low-forcing regime typically results in quasi-2D laminar flows which can hardly be considered turbulent. However, the compressible horizontal free-surface flow strongly affects the spatial distribution of passive tracers. The high-forcing regime gives rise to strongly inertia-dominated flow, including locally strong 3D secondary circulations and rapid vertical mixing of passive tracers, despite the shallowness of the fluid layer. Finally, the present investigation suggests that forcing too close to the vertical (no-slip) walls results in a substantial reduction of the horizontal integral length scale and enhanced production of small-scale 3D flows.