Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to align table elements #166

Closed
uniomni opened this issue May 29, 2012 · 0 comments
Closed

Ability to align table elements #166

uniomni opened this issue May 29, 2012 · 0 comments
Assignees

Comments

@uniomni
Copy link
Contributor

uniomni commented May 29, 2012

In particular we need to be able to right justify numbers.
However, when doing something like

row = TableRow(['12', '3000', '5'],
                               col_align=['right', 'right', 'right'])
print Table(row)

or 

cell_1 = TableCell('12', align='right')
cell_2 = TableCell('3000', align='right')
cell_3 = TableCell('5', align='right')
row = TableRow([cell_1, cell_2, cell_3])
print Table(row)

results in the error message:

  File "/home/nielso/sandpit/inasafe-dev/impact_functions/tables.py", line 391, in __str__
    max_column_count = self.max_column_count()
  File "/home/nielso/sandpit/inasafe-dev/impact_functions/tables.py", line 324, in max_column_count
    for row in self.rows:
TypeError: 'TableRow' object is not iterable
@ghost ghost assigned timlinux May 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants