2

I need to create a table based on a Python list and paste it in layout view in QGIS.

I also found a QgsLayoutTable class in PyQGIS but there's no example of creating a simple table.

If I had these objects:

layout = QgsProject.layoutManager().layouts()[0]

table_data = [
  ["a", "b"],
  [1, 2,
]

How could I create a QGIS layout table like

a b
1 2

and add it to the layout?

3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.