Collapse a column if nothing inside it?

Collapse a column if nothing inside it?

should I do it like this?
CSS      20% 60% 20%
content  col1 col2 col3
use jQuery to check if col1, col3 has content.
if none, remove/hide them, set col2 to 100%

or is there a better approach?