How to render a table dynamically ? #2904
-
Could you pls advise why it is wrong ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@yellowbean You have the order of the argument switched in your rx.table.header(
rx.table.row(
rx.foreach(
State.listResultHeader,
lambda x: rx.table.column_header_cell(x),
)
),
), Let me know if that works! |
Beta Was this translation helpful? Give feedback.
-
@picklelo Thanks ! I'm wondering how to render table via a 2-D list ? like here
But it wont' work |
Beta Was this translation helpful? Give feedback.
@yellowbean your code is correct, you just need to add a type annotation to your var (so it knows that its a list of lists that it can foreach, without this you may get a Javascript error by iterating over a non-list type)