How to create a tree table in Writer?

I refer to what the undermentioned depicts:

I can create tables and indented lists, but I don’t appear to be able to combine them.

If your goal is simply to “quote” a directory list inside a Writer document, you can proceed as follows:

  1. in a terminal, type command tree directory_name >out.txt
  2. a. open out.txt in a text editor and copy full contents into the clipboard
  3. a. paste into Writer
  4. apply Preformatted Text to imported data

or
2. b. in Writer, Insert>Text from File
3. b. no other operation needed

Remark: the output of step one can be voluminous if the directory hosts a deep hierarchy of sub-directories.


If this does not answer your question, reopen it (don’t use a comment) and describe what you want to achieve expected result) with an example if possible. I don’t understand what you want to “combine”. And don’t forget to mention OS name (which Linux distro? I guess your desktop is KDE Plasma) and LO version.

How to create a tree table in Writer? - #2 by ajlittoz

@ajlittoz,

It does not, although I’m thankful. I’m going to respond with a comment, because Discourse has no concept of thread closure, so I don’t know what you’re referring to.

I want to create a table with indents — a “tree grid”, as computer scientists frequently refer to it. I’ve a great, great many reasons for wanting to do so. Sometimes, to render example inode structures (as you estimated) but also, to format names with weights and descriptions (hence the table) but also variations (hence the hierarchy).

An interactive demonstration is SlickGrid example 5: Collapsing, per javascript - How to create a collapsing tree table in html/css/js? - Stack Overflow.

A hierarchical tree and the ability to display an entry’s associated attributes, as the aforeattached screenshot demonstrates.

This doesn’t apply to a specific OS and LO version, so I fail to see why this is of use. Regardless, I am using https://download.opensuse.org/repositories/openSUSE:/Factory/standard/x86_64/libreoffice-7.6.4.1-1.2.x86_64.rpm on cpe:/o:opensuse:tumbleweed:20240125. You accurately estimated my DE.

To edit any contribution, click on to expand the list of extra tools and select the “pencil” tool.

I’m aware of that, @ajlittoz, but did you not see:

…? I fail to understand what you’re asking of me. You seem to be treating this forum as if it were Bugzilla.

You can close a topic (it is not a “thread” like in forums because the answers can be reordered by the Discourse engine according to its own relevance criteria; you then lose chronological order).

To close a topic (but I don’t think it is necessary to do it), click on the wrench tool at bottom of all contribution. The pop-up menu contains a Close Topic item.

But what is really worthy for visitors is to know that a satisfying solution is provided. This is the role of the (initially) greyed checked box under any contribution. When it is enabled, this is more or less signalled in the questions home page.

If I understand your goal as the need to translate visually the nesting level of items in a tree-like structure, you can do this with a bullet list. That the list is stand-alone or inside a table is irrelevant.

The most user-friendly approach is to create both a custom list style and a dedicated paragraph style.

Custom list style

Create a new list style with name Void bullet.

  • in Position tab, adjust Indent at and Tab stop at for each level at the desired distance (both values must be the same); Number followed by Tab stop
    In this case, Aligned at is irrelevant. So, to avoid any possible unforeseen issue, set it at 0 cm for all levels
  • in Customize tab, set Number to Bullet and for level 1-10, press Select to choose space for the bullet symbol

Paragraph style

Create a new paragraph style SlickGrid (ideally derived from built-in List but it does not matter).

  • configure its properties to define the look of the list item, essentially the Font tab; don’t play with Indent parameters* (you can modify all others in Indents & Spacing but don’t touch Indent)
  • in Outline & List tab, associate your Void bullet list style with this paragraph style

How to use this?

When you want to enter a member of your "slick grid", assign paragraph style *SlickGrid* to the text. You can promote the item to the desired level by pressing Tab at start of the item. To demote it, press Shift+Tab at start of text.

Where is that, @ajlittoz? I ask because my GUI does not appear to utilize a tab system. I expect you’re using a non-default appearance?

Re-read carefully the “recipe”. When you create a new style, a dialog pops-up. This window has several tabs to organise parameters into “families”: Position defines the position of the bullet and the indent for each level, Customise the specific bullet or number kind, separators, … Paragraph style configuration dialog has different tabs because the parameters belong in different families.

1 Like

Thank you, @ajlittoz.

However, I’ve tried to create a new style using “New style from slection” from both the “Default paragraph style” and the “Bullets” character style, yet neither afford me the options you mention:

There are 5 style categories:

  • paragraph: for the bounding box geometry and default character style
    See your Body Text screenshot.
  • character: typographical properties of characters and also position relative to base line
    See your Bullets screenshot which is probably not what you expected.
  • page: for page geometry
  • frame: for “inserts” (images, drawings, secondary text blocks, …) geometry and interaction with main text
  • list: bullet/number position and “type”, indent for each list level
    This is what you should look for. You access the built-in list with a click on the fifth icon from left in the style sidepane toolbar. These styles are not well known and often disregarded. Most users jump on Format>Bullets & Numbering instead, but this is massive direct formatting and creates more problems later when you want to tune your document.
    Mastering this style category is not immediate. Experiment a bit to understand what each setting controls.

The sidepane toolbar also shows so called “table styles” but they are not “traditional” styles. They rather are a set of macros. Modifying a “table style” (when possible) never updates the existing tables. Personally, I avoid them because they blow up my styling in cells with their direct formatting.

1 Like