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))))))))))))
|