File: testHTMLTags1.py

package info (click to toggle)
karrigell 2.3.2-1.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 6,484 kB
  • ctags: 4,167
  • sloc: python: 18,122; ansic: 370; sh: 129; makefile: 53; xml: 29
file content (36 lines) | stat: -rw-r--r-- 957 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
from HTMLTags import *

print "".join([ str(TR(TD(i)+TD(i*i))) for i in range(100) ])

# a few tests

# create 3 cells for a table
cells = TD("bla",Class="even"),TD("bli", Class="odd"),TD("blo",Class="even")
# the row holding these cells
row = TR(cells,TD(' ')*2)

print B(I(FONT("ggg",face="courier")))

print OPTION('blabla',SELECTED=True,value=5)

print HTML(
    HEAD('blabla') +
    BODY(
        A("link",href="http://jjj"),
        SELECT(Sum([ OPTION(i,value=i) for i in range(10) ]), name="foo"),
        TABLE(row),'blabla',BR())
    )

print Sum([ TD(i) for i in range(5) ])


stylesheet = LINK(rel="Stylesheet",href="doc.css")

head= HEAD(TITLE('Record collection')+stylesheet)
title = H1('My record collection')
rows = Sum ([TR(TD(t,Class="title"),TD(a,Class="Artist")) 
    for a,t in [('You are the quarry','Morrissey'),('Buzzcocks','Love bites')] ])
table = TABLE(TR(TH('Title'),TH('Artist')),rows)

print HTML(head,BODY(title,table))