Skip to content

Why can't it loop in the table? #603

Open

Description

@bbhxwl

Why can't it loop in the table?

Image

Activity

  1. Ekvivokk commented on Jul 21, 2025

    @Ekvivokk

    The {%tr %} tags should be used here. That will also remove the row it's written in. But everything in the for loop will be repeated for every item. So everything you don't want repeated would need to be outside the loop.

    So you would have something like this. I've replaced the words I can't read with just info.

    info | {{ address }}

    header 1 | header 2 | header 3

    {%tr for order in orderLlist %}

    {{ type 1 }} | {{ startTime }} | empty

    info | info

    {{ orderType }} | empty | empty | empty

    {%tr endfor %}

  2. Clyde-la commented on Jul 23, 2025

    @Clyde-la

    表格里面的for循环要用 {%tr %} {%tr endfor %}

  3. bbhxwl commented on Jul 24, 2025

    @bbhxwl
    Author

    表格里面的for循环要用 {%tr %} {%tr endfor %}

    我这情况是比较复杂,是想开始图片,分2列,往下循环,结束图片分2列,往下循环,这样好像做不到?1列容易

  4. Clyde-la commented on Jul 24, 2025

    @Clyde-la

    一行好像只能一个for ,你要么把 开始图片和结束图片这4列一起for循环生成,要么在表格里套表格(子表格单独for)。

    tests/templates/dynamic_table_tpl.docx 去看下项目里的示例就知道了

  5. bbhxwl commented on Jul 29, 2025

    @bbhxwl
    Author

    一行好像只能一个for ,你要么把 开始图片和结束图片这4列一起for循环生成,要么在表格里套表格(子表格单独for)。

    tests/templates/dynamic_table_tpl.docx 去看下项目里的示例就知道了

    那看来我这需求很难了,开始图片和结束图片要分左右,而且开始可能是1个,结束可能是6个,也可能开始6个,结束1个,都不太固定。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions