Rosetta Code:Village Pump/Foldable output: Difference between revisions

Working solutions with scrollbars
(Textarea bombed.)
(Working solutions with scrollbars)
Line 13:
 
:I just tried using the textarea tag and that failed too. I had hoped that something like: '<nowiki><textarea cols="80" rows="20" readonly="readonly" wrap="off"></nowiki>' would confine the output to a scrollable box, but it did not work. --[[User:Paddy3118|Paddy3118]] 05:59, 29 October 2008 (UTC)
 
:: A good idea. The following works:
:: <nowiki><pre style="height:30ex;width:98%;overflow:scroll"></nowiki>
:: Example:
<pre style="height:30ex;width:98%;overflow:scroll">
Test
Another line
Yet another line, this time one which clearly is much longer than the width of the browser window, at least assuming normal screen dimensions and font settings, and assuming the browser window is not wider than the screen (which would be impractical anyway).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre>
973

edits