Assuming that gravity was essentially the same (other answers to this question notwithstanding), very large dinosaurs were dealing with the same forces that they would today. There are two clades of dinosaurs in which gigantism evolved, Sauropoda (quadrupdeal sauropods) and Theropoda (including T. rex). Each "solved" the problem of large size in different (but also somewhat similar) ways.
The main reason why large size was not a problem was that, if posture changed to align the forces between the animal and the ground, the bones are compressed. Bone is very strong in compression.
Theropod essential operate as a see-saw, with a large muscular tail balancing a large head. As such, they did not likely use much active muscular force to balance. The analogy is a human standing. Just standing, you don't need much muscle force to balance.
Hutchinson and Garcia (2002) showed that, because of a lack of plausibly large leg musculature, T. rex could not run. For a range of postures, they estimated how much muscle would be required to balance the animal and found that running behavior was unlikely.
Hutchinson, J.R. and M. Garcia. 2002. Tyrannosaurus was not a fast runner. Nature 415:1018-1021.
Sauropods show many similar adaptations as elephants, the largest extant land mammals. Their limbs were held upright (erect), which requires less energy for balance. Some sauropods had air-filled bones, which would also lighten the skeleton. Wilson and Carrano (1999) document the evolution of posture through sauropod evolution from a biomechanical perspective.
Wilson, J.A. and M.T. Carrano. 1999. Titanosaurs and the origin of “wide-gauge” trackways: a biomechanical and systematic perspective on sauropod locomotion. Paleobiology 25:252–267.