File: normalizeTable.ur

package info (click to toggle)
urweb 20170105%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,640 kB
  • ctags: 9,972
  • sloc: ansic: 6,402; lisp: 1,198; makefile: 173; sh: 44; sql: 1
file content (50 lines) | stat: -rw-r--r-- 775 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
fun main () =
visible <- source True;
return
    <xml>
      <body>
	<section>
	  <h1>Static table</h1>
	  <table border=1>
	    <thead>
	      <tr>
		<th>Column 0</th>
		<th>Column 1</th>
	      </tr>
	    </thead>
	    <tbody>
	      <tr>
		<td>A</td>
		<td>B</td>
	      </tr>
	    </tbody>
	  </table>
	</section>

	<section>
	  <h1>Dynamic table</h1>
	  <table border=1>
	    <thead>
	      <tr>
		<th>Column 0</th>
		<th>Column 1</th>
	      </tr>
	    </thead>
	    <tbody>
	      <dyn signal={
		 visible <- signal visible;
		 return (if visible then
			     <xml>
			       <tr>
			       <td>A</td>
			       <td>B</td>
			       </tr>			       
			     </xml>
			 else
			     <xml></xml>)
	      }/>
	    </tbody>
	  </table>
	</section>
      </body>
    </xml>