Space & time are parts of a whole.

Time and space are different aspects of the quantity spacetime. Gravity has something to do with curvature of spacetime.

Curvature is like tracing a shadow of a string suspended above a saddle onto the saddle, then flattening out the saddle. That curvy looking two dimensional line was a straight line in a third dimension.


Source