6

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

0

3 Answers 3

7

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

9
  • 1
    That works well, Thanks very much! Feb 13, 2020 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. Feb 13, 2020 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! Apr 8, 2020 at 16:26
  • Do you have the atlas preview on? Apr 8, 2020 at 16:30
  • Is that in the atlas tab? generate an atlas? Apr 8, 2020 at 16:32
3

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

0

There's also another workaround:

  1. Insert an attribute table
  2. in "Main properties" / "Attributes..." select only one attribute to display
  3. Repeat this process and just put one table below the other one by one

Your Answer

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

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