Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

How can I add a "Table"

+2 votes

I need to reproduce, but I can't seem to figure out, how to produce a 3 col entity object. Any ideas?

in Help by (190 points)

1 Answer

+1 vote

Creating table nodes for text-only content really does not play to yEd's strengths.


Update:

There is a second, much simpler solution. Tables for presenting text-only content can be created using HTML formatting:

Please see How can I achieve different text stylings within one label? for more information on HTML formatting.


Nevertheless, it is possible to create such nodes with (a lot of effort and) the available table style templates:

Steps to reproduce:

  1. Create a node from the "Table" template in the "Swimlane Nodes and Table Nodes" palette section.
  2. Right-click the new node to open its context menu. Choose "Add Column".
  3. Open the context menu again and choose "Add Row".
  4. Repeat step 3 two times.
  5. Press and hold CTRL and SHIFT and click on each of the column and row header labels to select all of them.
  6. Remove the selected labels with DELETE.
  7. Click into a column header. Use CTRL+A to select all columns.
  8. Set "Header Height" to "0" in the properties view in yEd's lower right corner.
  9. Repeat step 7 for the rows in the table.
  10. Set "Header Width" to "0".
  11. Select the whole table node.
  12. Set "Fill Color", "Fill Color 2", "Lane Color", "Lane Color 2", "Lane Header Color", "Lane Header Color 2", and "Lane Header Color 3" to white (or any other desired color).
  13. Change the node's "Text" to "Kunde".
  14. Move the mouse over the right border of the first column. Press and hold the left mouse button. Drag the mouse to resize (shrink) the column to the desired width.
  15. Repeat for all other columns.
  16. Move the mouse over the lower border of the first row. Resize the row to the desired height.
  17. Repeat for all the other rows.
  18. Open the context menu and choose "Add Label".
  19. Add "PK" as label text and finish label text editing with ENTER/RETURN.
  20. Press and hold CTRL and click on the new label to select it.
  21. Drag the selected label to the desired position.
  22. Repeat steps 18 to 21 for all further labels.

That is it.

Note, the image above is linked to a corrsponding GraphML file.

by [yWorks] (161k points)
edited by
Thank you, I see, there is not really a perfect solution, but both work. The HTML label content one is rather messy to maintain. Is there a chance to get a "table" formatting included? Like writing `col1|col2|col3` as label text and get it split to 3 columns (would work with a single "content" label)?
To be honest, the chance for some kind of custom table markup is very, very slim. yEd's focus is much more on structural diagramming than support for structural text representation.

That said, I think you would profit much more from switching to ERD notification than from any yEd improvement for visualizing text tables.
Legal Disclosure | Privacy Policy
...