使用python水平划分单元格

时间:2019-03-26 06:42:25

标签: html python-3.x

I'm trying to add split the html cell from 2nd cell onwards for the whole table
----------|---------------------|--------------------|
          |---------------------|--------------------|
----------|---------------------|--------------------|
          |---------------------|--------------------|
----------|---------------------|--------------------|
          |---------------------|--------------------|
----------|---------------------|--------------------|
          |---------------------|--------------------|
----------|---------------------|--------------------|
          |---------------------|--------------------|
----------|---------------------|--------------------|
          |---------------------|--------------------|
----------|---------------------|--------------------|
          |---------------------|--------------------|
----------|---------------------|--------------------|
   First column will be contain title and second column onwards will be splitted in two cells

 Earlier I was doing something like this and I was able to implement that successfully


 ----------|---------------------|--------------------|
           |                     |                    |
 ----------|---------------------|--------------------|
           |                     |                    |
 ----------|---------------------|--------------------|
           |                     |                    |
 ----------|---------------------|--------------------|

for timestamp in reversed(revlo_ord_timestamps):
    specific += '<th>' + timestamp + '</th>'
specific += '''</tr>'''

def get_specific(value, value1, name, specific):
    specific += '''<tr><th>''' + name + '''</th>'''
    for data in (reversed(value)):
        specific += '<td>'  + str(data)  + '</td>'
    for data in (reversed(value1)):
        specific += '<td>'  + str(data)  + '</td>'
    return specific

 ----------|-----value-----------|--------------------|
      name |---------------------|--------------------|
 ----------|-----value-----------|--------------------|

我想要上面的输出,有人可以帮我这个忙,我将非常感谢您的帮助。我对它有些陌生,并陷入其中,我应该如何在这里成功实现

0 个答案:

没有答案