File: test.cl

package info (click to toggle)
cl-portable-aserve 20190720.gitcac1d69%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,240 kB
  • sloc: lisp: 22,564; makefile: 55; sh: 36
file content (73 lines) | stat: -rw-r--r-- 1,847 bytes parent folder | download | duplicates (10)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
(defpackage :user (:use :htmlgen))

(defun simple-table-a ()
  (with-open-file (p "~/public_html/test.html"
		   :direction :output
		   :if-exists :supersede)
    
    (html-stream p 
		 (:html
		  (:head (:title "Test Table"))
		  (:body (:table 
			  (:tr (:td "0") (:td "0"))
			  (:tr (:td "1") (:td "1"))
			  (:tr (:td "2") (:td "4"))
			  (:tr (:td "3") (:td "9"))
			  (:tr (:td "4") (:td "16"))
			  (:tr (:td "5") (:td "25"))))))))

(defun simple-table-b ()
  (with-open-file (p "~/public_html/test.html"
		   :direction :output
		   :if-exists :supersede)
    
    (html-stream p 
		 (:html
		  (:head (:title "Test Table"))
		  (:body ((:table border 2)
			  (:tr (:td "0") (:td "0"))
			  (:tr (:td "1") (:td "1"))
			  (:tr (:td "2") (:td "4"))
			  (:tr (:td "3") (:td "9"))
			  (:tr (:td "4") (:td "16"))
			  (:tr (:td "5") (:td "25"))))))))


(defun simple-table-c (count)
  (with-open-file (p "~/public_html/test.html"
		   :direction :output
		   :if-exists :supersede)
    
    (html-stream p 
		 (:html
		  (:head (:title "Test Table"))
		  (:body ((:table border 2)
			  (dotimes (i count)
			    (html (:tr (:td (:princ i))
				       (:td (:princ (* i i))))))))))))

(defun simple-table-d (count border-width backg-color border-color)
  (with-open-file (p "~/public_html/test.html"
		   :direction :output
		   :if-exists :supersede)
    
    (html-stream p 
		 (:html
		  (:head (:title "Test Table"))
		  (:body ((:table border border-width
				  bordercolor  border-color
				  bgcolor backg-color
				  cellpadding 3)
			  (:tr ((:td bgcolor "blue") 
				((:font :color "white" :size "+1")
				 "Value"))
			       ((:td bgcolor "blue") 
				((:font :color "white" :size "+1")
				 "Square"))
			       )
			  (dotimes (i count)
			    (html (:tr (:td (:princ i))
				       (:td (:princ (* i i))))))))))))