wide_format.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:sphinx-jsonschema 作者: lnoor 项目源码 文件源码
def _calc_spans(self, rows, nrcols):
        # calculate colspan
        for row in rows:
            target = None
            for c in range(nrcols):
                if row[c] is not None:
                    # try to extend colspan on this cell
                    target = row[c]
                else:
                    if target is not None:
                        # extend colspan
                        target[1] += 1

        # convert arrays to tuples
        # arrays are needed to patch up colspan and rowspan
        # the table builder requires each cell to be a tuple, not an array
        for row in rows:
            for c in range(nrcols):
                if row[c] is not None:
                    row[c] = tuple(row[c])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号