182
184
self.page.append(" </caption>\n")
183
185
self.page.append(' <tr>\n')
185
def NewCell(self,color=ColorType.WHITE):
186
size = str(round(self.col_size[self.current_col]/sum(self.col_size)*100,0))
187
self.current_col=self.current_col+1
187
def NewCell(self,color=ColorType.WHITE,span=1):
189
for ii in range(0,span):
190
size += self.col_size[self.current_col+ii]
191
size = str(round(size/sum(self.col_size)*100,0))
192
self.current_col=self.current_col+span
189
194
if self.current_col>self.number_col:
190
195
logging.getLogger('MA5').warning(" the number of the current column is bigger than the total number of declared columns.")
191
196
if self.first_cell==True:
192
self.page.append(' <td width=\'' + size + '%\' bgcolor=\'' + \
193
ColorType.convert2hexa(color)+ '\'>\n')
197
self.page.append(' <td width=\'' + size + '%\' bgcolor=\'' + ColorType.convert2hexa(color)+'\'')
195
self.page.append(' </td> \n' + \
196
' <td width=\'' + size + '%\' bgcolor=\'' + \
197
ColorType.convert2hexa(color)+'\'>\n')
199
self.page.append(' </td> \n' + ' <td width=\'' + size + '%\' bgcolor=\'' + ColorType.convert2hexa(color)+'\'')
201
self.page.append(' colspan=\"'+ str(span) + '\"')
202
self.page.append('>\n')
198
203
self.first_cell=False
200
205
def NewLine(self):
201
206
self.current_col=0
202
207
self.first_cell=True
203
208
self.page.append(" </td>\n </tr>\n <tr>\n")
205
210
def EndLine(self):
206
211
self.current_col=0
207
212
self.first_cell=True
208
213
self.page.append(" </td>\n </tr>\n")
210
215
def EndTable(self):
211
216
self.table=self.table-1
212
217
self.page.append(" </table><br /> <br />\n")
216
219
def WriteFigure(self,caption,filename):
217
220
thefile = os.path.normpath(filename)
218
221
im = PngReader(thefile+'.png')
231
234
self.page.append(' <img src=\'' + os.path.basename(filename) + \
232
235
'.png\' ' + 'height=\''+ str(scale*im.header.height)+'\' alt =\'\' />\n')
233
236
self.page.append(" </center><br /> <br />\n")
236
238
def WriteFoot(self):
237
239
if self.bullet!=0:
238
240
logging.getLogger('MA5').warning(" the number of 'OpenBullet()' and 'CloseBullet()' are different.")