reportlab/platypus/tables.py
changeset 1218 07492dc0be86
parent 1207 49a514d10cb0
child 1253 89eee99a7a00
--- a/reportlab/platypus/tables.py	Tue Sep 18 12:37:40 2001 +0000
+++ b/reportlab/platypus/tables.py	Wed Sep 19 22:19:35 2001 +0000
@@ -1,8 +1,8 @@
 #copyright ReportLab Inc. 2000
 #see license.txt for license details
 #history http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/reportlab/platypus/tables.py?cvsroot=reportlab
-#$Header: /tmp/reportlab/reportlab/platypus/tables.py,v 1.43 2001/09/13 19:06:43 aaron_watters Exp $
-__version__=''' $Id: tables.py,v 1.43 2001/09/13 19:06:43 aaron_watters Exp $ '''
+#$Header: /tmp/reportlab/reportlab/platypus/tables.py,v 1.44 2001/09/19 22:19:35 andy_robinson Exp $
+__version__=''' $Id: tables.py,v 1.44 2001/09/19 22:19:35 andy_robinson Exp $ '''
 __doc__="""
 Tables are created by passing the constructor a tuple of column widths, a tuple of row heights and the data in
 row order. Drawing of the table can be controlled by using a TableStyle instance. This allows control of the
@@ -18,10 +18,6 @@
 tables and table styles.
 """
 
-### HACK HACK HACK
-# NUDGE SHOULD BE DISABLED FOR TABLES INSIDE TABLES
-DO_NUDGE = 1
-
 from reportlab.platypus import *
 from reportlab import rl_config
 from reportlab.lib.styles import PropertySet, getSampleStyleSheet
@@ -112,6 +108,7 @@
 	def __init__(self, data, colWidths=None, rowHeights=None, style=None,
 				repeatRows=0, repeatCols=0, splitByRow=1):
 		#print "colWidths", colWidths
+		self.hAlign = 'CENTER'
 		self._nrows = nrows = len(data)
 		if len(data)==0 or type(data) not in _SeqTypes:
 			raise ValueError, "%s must have at least 1 row" % self.identity()
@@ -498,18 +495,11 @@
 			raise NotImplementedError
 
 	def draw(self):
-		global DO_NUDGE # ONLY NUDGE IF NOT IN ANOTHER TABLE (HACK)
-		nudge = 0.5 * (self.availWidth - self._width)
-		if DO_NUDGE:
-			self.canv.translate(nudge, 0)
-		OLD_DO_NUDGE = DO_NUDGE
-		DO_NUDGE = 0
 		self._drawBkgrnd()
 		self._drawLines()
 		for row, rowstyle, rowpos, rowheight in map(None, self._cellvalues, self._cellStyles, self._rowpositions[1:], self._rowHeights):
 			for cellval, cellstyle, colpos, colwidth in map(None, row, rowstyle, self._colpositions[:-1], self._colWidths):
 				self._drawCell(cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight))
-		DO_NUDGE = OLD_DO_NUDGE
 
 	def _drawBkgrnd(self):
 		for cmd, (sc, sr), (ec, er), color in self._bkgrndcmds: