6

I'm trying to create a label in QGIS that is formatted similar to the "table" styled yellow labels in the image below. The image is from a map created in AutoCAD. I would like the labels linked to my attribute table which includes all that info.

Table style label

I tried to use an expression to create a custom label, but it is quite limiting when it comes to formatting. Does anyone have any ideas on how I could do this?

Name || ': ' || Depth_1 || '\n' || 'CL  ' || cl ||'(mg/L)' || '\n' || Name || ': ' || Depth_2 || '\n' || 'S04  ' || s04 ||'(mg/L)'

My attempt at making "table label"

4
  • It looks like you've already solved your problem as well as QGIS will allow. One suggestion, would be to add some spaces to the shorter lines so the underline formatting is the same length on each line. And you could add the vertical line symbol | to imitated table cell dividers.
    – csk
    Commented Feb 13, 2018 at 19:49
  • Yes, you will need to use dynamic SVG see these answer for full explanation on how to implement this : gis.stackexchange.com/questions/380964/… and gis.stackexchange.com/questions/379437/…
    – J.R
    Commented Feb 11, 2022 at 16:50
  • Hello - i know this is an old question, but I see the new QGIS 3.28 allows for HTML formating of labels. I am not familiar with HTML - but wondering if this would allow for labels to be made like in the original question. For reference the data for each label is in a spreadsheet - or could be added to the point layer attribute data. Thanks! Commented Jan 12, 2023 at 19:35
  • I just tried creating a table-label based on attributes - and it didn't work. QGIS placed all values in different rows instead of within the same row.
    – Erik
    Commented Apr 2 at 13:53

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.