A table class to create table cells. Example: cell = SimpleTableCell('Hello, world!')
| 64 | |
| 65 | |
| 66 | class SimpleTableCell: |
| 67 | """A table class to create table cells. |
| 68 | |
| 69 | Example: |
| 70 | cell = SimpleTableCell('Hello, world!') |
| 71 | """ |
| 72 | |
| 73 | def __init__(self, text, header=False): |
| 74 | """Table cell constructor. |
| 75 | |
| 76 | Keyword arguments: |
| 77 | text -- text to be displayed |
| 78 | header -- flag to indicate this cell is a header cell. |
| 79 | """ |
| 80 | self.text = text |
| 81 | self.header = header |
| 82 | |
| 83 | def __str__(self): |
| 84 | """Return the HTML code for the table cell.""" |
| 85 | if self.header: |
| 86 | return "<th>%s</th>" % (self.text) |
| 87 | else: |
| 88 | return "<td>%s</td>" % (self.text) |
| 89 | |
| 90 | |
| 91 | class SimpleTableImage: |
no outgoing calls
no test coverage detected