reportlab/platypus/tables.py
changeset 2474 5462fb8b792d
parent 2472 6795e616cdbe
child 2475 24a8e6ffc36a
equal deleted inserted replaced
2473:10d3b640b4f7 2474:5462fb8b792d
   665 
   665 
   666     def minWidth(self):
   666     def minWidth(self):
   667         W = list(self._argW)
   667         W = list(self._argW)
   668         width = 0
   668         width = 0
   669         elementWidth = self._elementWidth
   669         elementWidth = self._elementWidth
   670         for colNo, w in enumerate(W):
   670         rowNos = xrange(self._nrows)
       
   671         values = self._cellvalues
       
   672         styles = self._cellStyles
       
   673         for colNo in xrange(len(W)):
       
   674             w = W[colNo]
   671             if w is None or w=='*' or _endswith(w,'%'):
   675             if w is None or w=='*' or _endswith(w,'%'):
   672                 final = 0
   676                 final = 0
   673                 for rowNo in range(self._nrows):
   677                 for rowNo in rowNos:
   674                     value = self._cellvalues[rowNo][colNo]
   678                     value = values[rowNo][colNo]
   675                     style = self._cellStyles[rowNo][colNo]
   679                     style = styles[rowNo][colNo]
   676                     new = (elementWidth(value,style)+
   680                     new = (elementWidth(value,style)+
   677                            style.leftPadding+style.rightPadding)
   681                            style.leftPadding+style.rightPadding)
   678                     final = max(final, new)
   682                     final = max(final, new)
   679                 width += final
   683                 width += final
   680             else:
   684             else: