Hide keyboard shortcuts

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 * 

3 

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* 

13 

14 **Key Arguments** 

15 

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 

20  

21 

22 **Return** 

23 

24 - ``th`` -- the table header cell 

25  

26 """ 

27 if color is False: 

28 color = "" 

29 

30 if href is False: 

31 href = "" 

32 link = "" 

33 else: 

34 href = """href="%(href)s" """ % locals() 

35 link = "link" 

36 

37 if span is False: 

38 span = "" 

39 else: 

40 span = "span%(span)s" % locals() 

41 

42 if columnWidth is False: 

43 columnWidth = "" 

44 else: 

45 columnWidth = """style="width: %(columnWidth)s%%;" """ % locals() 

46 

47 if popover is False: 

48 popover = "" 

49 

50 th = """<th %(href)s class="%(color)s %(link)s %(span)s" %(columnWidth)s %(popover)s>%(content)s</th>""" % locals() 

51 

52 return th