It's better to get under a table than under a doorway, because a table has more surface area than a doorway and provides more protection from falling objects. And if the building collapses on top of you, a table gives you a bubble of air to breathe.
But if the ground right underneath you gives way, you're essentially doomed.