I have a page with dashboard similar to iGoogle. I need to have the page work on the available client width.
I wrote a JavaScript to get the width and distribute it evenly amongst the divs. This script sets the element.style{width: 540px;} for the divs and it works very well when the page loads. Its
something like:
window.onload = function SetWidth(){ document.getElementById(dashCell.id).style.width = (Math.round(window.innerWidth / 2)) + 'px';};
Now comes the pain point. The page has an UpdatePanel with an Timer which does a PostBack every 5000 milliseconds. This spoils the design as the page is loaded again and the element.style is lost.
I have read about fluid CSS and also considered using min-width and max-width CSS attributes. But the need of the hour is to get it working this way. I need a working solution for now, but better and right ways to achieve this are definitely welcome.
overflow: visible;for these divs with a fixed width or percentage width for container divs. But at least the outermost div should have a fixed width or else the page just keeps growing. I will still give this a try (its a lot of change) and get back to you asap. Thanks for the suggestion.tablesbeing used in some places on the page. Nevertheless, I take your suggestion as a valid answer and a point in doing it the right way. Thanks!