Transpose attribute table in QGIS Composer?
There is no direct way to rotate/transpose your attribute table in the map composer as far as I know. A workaround to this is:
- Right-click the file and go to save as, then Save your attribute table as CSV. If you don't want to add XY coordinates as additional columns to the CSV file, select
Default
inGEOMETRY
underLayer options
.
- Open the CSV file in Excel
- Then copy the columns
- Paste them in another sheet with using paste special, and select Transpose
- Save it again as CSV file
Then drag and drop the new CSV file into QGIS. In the composer add the transposed attribute at the bottom of your map.
@ahmadhanb's answer is a good workaround but here is another way to deal with long tables.
Although there is no way to transpose a table in the composer, you can split your table into multiple frames. Now depending on the case, this could be more or less elegant, but this is how the result looks like:
Here's how to do it:
- Add a table as you would normally do and select its source layer.
- Scroll down the properties till you get to Frames.
- Click Add Frame.
- Align and resize your frames as may be suitable to your map layout.
- It is also a good idea to turn on Show only features visible within a map. This way you won't have a table with all the layer features on your map!
P.S. It is possible to rotate the table, but unfortunately, the text also rotates and you end up with vertical text, which doesn't look very elegant.