Add grid margins and spacing to export code