fugtruck
04-08-2003, 09:58 AM
I have several sections of text that I keep hidden with tags:
<div id="Section0" style="display:none;">Text here</div>
<div id="Section1" style="display:none;">Text here</div>
.
.
<div id="Section10" style="display:none;">Text here</div>
I call a Javascript to display one section and hide any others that are displayed. All this is contained within a table to 1) maintain a constant width, and 2) to keep it centered on the screen (the table is centered, the text is left aligned within the table ).
The problem is that the text that is hidden can be quite long and it makes the page long, even when it is blank. When you are viewing a long section of text and call a javascript to hide it and display a shorter one, it leaves you at a blank spot on the screen and you have to scroll up, which is confusing.
One way around this is instead of keeping the text in a table, to keep it in a tag like:
<div style="overflow:auto;width:800px;" align="center">
...body here
</div>
This solves the problem of maintaining a constant width as well as keeping you on the part of the page that is displaying the text. However, this makes everything center aligned. If I have a nested tag to left align the text, it left aligns the entire body.
Any suggestions on how to overcome this?
<div id="Section0" style="display:none;">Text here</div>
<div id="Section1" style="display:none;">Text here</div>
.
.
<div id="Section10" style="display:none;">Text here</div>
I call a Javascript to display one section and hide any others that are displayed. All this is contained within a table to 1) maintain a constant width, and 2) to keep it centered on the screen (the table is centered, the text is left aligned within the table ).
The problem is that the text that is hidden can be quite long and it makes the page long, even when it is blank. When you are viewing a long section of text and call a javascript to hide it and display a shorter one, it leaves you at a blank spot on the screen and you have to scroll up, which is confusing.
One way around this is instead of keeping the text in a table, to keep it in a tag like:
<div style="overflow:auto;width:800px;" align="center">
...body here
</div>
This solves the problem of maintaining a constant width as well as keeping you on the part of the page that is displaying the text. However, this makes everything center aligned. If I have a nested tag to left align the text, it left aligns the entire body.
Any suggestions on how to overcome this?