5

I have an attribute table in QGIS with many columns and just one feature. I want to display it in my atlas with the attributes showing vertically, otherwise it is off the page. Is there a way to do this?

Newest QGIS 3.10.2

5

No way to pivot the inserted attribute table as of version 3.10.

You would have to do it in a label.

Simply just with the values:

enter image description here

Or if you need to maintain a table like look you can use HTML:

enter image description here

HTML table: https://www.w3schools.com/html/html_tables.asp

|improve this answer|||||
  • 1
    That works well, Thanks very much! – Laura Bennett Feb 13 at 17:14
  • 2
    Hi Laura, if the answer has solved your issue, please select is as correct using the green check mark next to the answer. – HeikkiVesanto Feb 13 at 17:56
  • Hi Heikki,, This worked really well at fist but now has stopped working! Can't work out why, any ideas? used the first method i.e. Area (ha): [% "Area (ha)"%] but its just showing Area (ha): [Area (ha)] in the box. I've tried starting again with a new box but it just does the same. Thanks in advance! – Laura Bennett yesterday
  • Do you have the atlas preview on? – HeikkiVesanto yesterday
  • Is that in the atlas tab? generate an atlas? – Laura Bennett yesterday
1

With a virtual layer, you can tricky make another table. The following query is for 4 fields, adjust-it as you want :

WITH t1(c1, c2, c3, c4) AS ( -- add as much as you want of field aliases
  SELECT
    ID, FIELD_NAME1, FIELD_NAME2, FIELD_NAME3 -- list here all the fields you want
  FROM YOUR_LAYER -- change with your layer name
)

SELECT c1 AS "My Pretty Field Header" FROM t1 UNION ALL
SELECT c2 FROM t1 UNION ALL
SELECT c3 FROM t1 UNION ALL
SELECT c4 FROM t1 -- add lines as much as fields and name it properly.

Or take a look at this code and adapt it for make a list for each fields : https://madmanwoo.gitlab.io/foss4g-python-workshop/expression_functions/#layout-example

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.