# HG changeset patch # User John "Elwin" Edwards # Date 1388680797 18000 # Node ID 7303535b5a5d84e423c293d528b36e5fd664e931 # Parent e8f3b7994d88d2b07c42d7ca40c0b4867ab8c7fd Right-align the numeric columns. The Game.printTable() method now right-aligns the name, rank, and score columns, by giving their cells a different CSS class. diff -r e8f3b7994d88 -r 7303535b5a5d py/rlgalldb.py --- a/py/rlgalldb.py Tue Dec 31 13:36:19 2013 -0500 +++ b/py/rlgalldb.py Thu Jan 02 11:39:57 2014 -0500 @@ -39,6 +39,7 @@ rowstart = '
\n' rowend = '
\n' cell = ' {0}\n' +rcell = ' {0}\n' hcell = ' {0}\n' tblend = '\n' pend = "\n" @@ -112,24 +113,25 @@ clist = [] for field in fields: if field == "rank": - clist.append("{0}".format(i + 1)) + clist.append(("{0}".format(i + 1), rcell)) elif field in entry: thing = entry[field] if field == "game": - clist.append(thing.name) + clist.append((thing.name, cell)) elif field == "xl" or field == "score": # Numerics - clist.append(str(thing)) + clist.append((str(thing), rcell)) elif field == "name": - clist.append(playerlink(thing)) + clist.append((playerlink(thing), cell)) elif field == "fate": - clist.append(thing) + clist.append((thing, cell)) elif field == "endt": - clist.append(linktoArchive(entry)) + clist.append((linktoArchive(entry), cell)) else: - clist.append("{0}".format(thing)) + clist.append(("{0}".format(thing), cell)) else: - clist.append("N/A") - of.write(maketablerow(clist)) + clist.append(("N/A", cell)) + rowstr = rowstart + "".join([ t.format(s) for (s, t) in clist ]) + rowend + of.write(rowstr) of.write(tblend) return diff -r e8f3b7994d88 -r 7303535b5a5d web/scoring/scores.css --- a/web/scoring/scores.css Tue Dec 31 13:36:19 2013 -0500 +++ b/web/scoring/scores.css Thu Jan 02 11:39:57 2014 -0500 @@ -42,3 +42,9 @@ display: table-cell; padding: 0 1em; } + +span.sdatar { + display: table-cell; + padding: 0 1em; + text-align: right; +}