Tables: Fixed pagination wrapping (fixes #5419)