I added web interface for a program’s output which looks like this:
<body>
<table id="header" approx height is 100px, width is 50% of screen located in the middle>
...
</table>
<div id="programoutput">my program outputs stuff here using Ajax.PeriodicalUpdater</div>
</body>
I use css for the div
#programoutput{ white-space:pre; }
and output from the program might contain very long lines. So, web page should have horizontal scrollbars then. What I want, is to make sure that the #header is always in the middle of the screen (not the body) and the body might become wider then the viewport based on the width of #programoutput.
I almost got it already, but I have some problems: horizontal scroll bar appears in the #programoutput itself not the window. and if height of the output is small (like a few lines in this case) then the horizoncal scroll bar is located in the middle of the window.
At this point your
tableshould be placed in the center of view port, and yourdivshould be long enough for yourbodyto generate scrollbar.But since the
tableisposition:fixed, yourdivwould “float” over your table. Now you have several options:1. Give your
diva top position:2. Place your
divat the bottom of thebody(this seems valid in your code piece):