just wanted to share this if others needed to do something similar ..
I needed a way to "collapse" the right sidebar margin , as otherwise , the monthly view of my largely-populated calendar was going haywire and dropping to the bottom of the page with a huge gap in the middle of the page (was using the spreadfirefox theme).
I finally found the cause was, in layout.css, there was:
* html body .centercolumn
{
margin-right : 247px;
margin-left : 150px;
}
when i would make margin-right to 0 px,
the calendar views would work great (go all the way till the end of the page) but then all other pages would be messed up, because i had a few blocks on the right sidebar on the other pages.
what i finally did was:
1. added a block to the footer with the following javascript code:
document.getElementById("centercolumn").style.marginRight = "0px";
this changes the value of the right margin of the main content section dynamically on the page to stretch till the end of the page.
2. i set this block to display only on pages having the problematic calendar views (monthly/ weekly views)
show only on listed pages:
event/*/*/*/week/*/*
event/*/*/*/month/*/*
3. Added the id "centercolumn" to the centercolumn div in the page.tpl.php so that the javascript finds this element.
basically changed:
to