Coverage for khufu/tables/th.py : 79%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# encoding: utf-8
2from . import *
4def th(
5 content="",
6 color=False,
7 href=False,
8 popover=False,
9 span=False,
10 columnWidth=False):
11 """
12 *Generate a table header cell - TBS style*
14 **Key Arguments**
16 - ``content`` -- the content
17 - ``color`` -- [ sucess | error | warning | info ]
18 - ``href`` -- add a link for the header cell (to sort for example)
19 - ``popover`` -- add helper text
22 **Return**
24 - ``th`` -- the table header cell
26 """
27 if color is False:
28 color = ""
30 if href is False:
31 href = ""
32 link = ""
33 else:
34 href = """href="%(href)s" """ % locals()
35 link = "link"
37 if span is False:
38 span = ""
39 else:
40 span = "span%(span)s" % locals()
42 if columnWidth is False:
43 columnWidth = ""
44 else:
45 columnWidth = """style="width: %(columnWidth)s%%;" """ % locals()
47 if popover is False:
48 popover = ""
50 th = """<th %(href)s class="%(color)s %(link)s %(span)s" %(columnWidth)s %(popover)s>%(content)s</th>""" % locals()
52 return th