Automatic numbering of a column in a table

When I try to automatically number a column down the rows in a table it goes 1-9 then repeats 1 then repeats 2. Help!, it goes to 9 and th

Tables are for Writer, but columns also exist in Calc. Although the question is tagged as writer, it resembles a narrow column in Calc, formatted as text.

1
2
3
…
9
1(0 hidden)
1(1 hidden)
1(2 hidden)
…
1(9 hidden)
2(0 hidden)
2(1 hidden)

How did you do that?
Is this actually about a column of a TextTable in a Writer document?

1 Like

No. (Did you try?)

Yes. But I see the red triangle overflow symbol.

1 Like

I assume you are working with a table in Writer. You can mark the column and apply a list style to it, e.g the style “Numbering 123”. The numbers are shown even if the list items are empty. If you later insert or delete a row, the numbering adapts automatically.

1 Like

There are two possibilities for this.

  • the easiest is described by @Regina: usage of a list style
    I’d recommend use of an “independent” (dedicated) list style so that you have no accidental interference between your table(s) and eventual numbered lists in your document. This is consistent with semantic styling approach where each specific significance is assigned its own style.

    I suggest that you type at least a space in the list items: under some circumstances (related with M$ Word compatibility rules), Writer suppresses “decorations” like list number on empty paragraphs and purely ignores such empty paragraphs. A space insures that the paragraph is not empty and will always be kept.

  • a (logically) more correct one is the insertion of a Number range field
    It is a bit more complicated because you have more manual steps but gives you more control.

  1. Insert>Field>More Fields, Variables tab
  2. Type Number range
  3. on first insertion, create a new counter by giving it a Name like “RowNumber”; on subsequent insertions, Select the counter name
    The same counter can be used for several tables by resetting the value in the first row.

With a Number range field, there is no need to add a “fail-safe” space and you have no visual alignment problem, no matter the choice. Also it is easier to manage alignment (left, centre, right) than with a list style.

I tried the second method on a trial basis:
8_LO-WRiTER_TABELLEn_automatisch fortlaufende zeilenweise Nummerierung je Tabelle_021647.pdf (295.7 KB)
[this file is in Deutsch]

… have a look to “Tabelle 2”: column “B”.

You can reset the number of cell (col 1, row1) of second table by forcing the value of the counter on insert (“Wert” entry box). Make sure this “static” value is not forwarded on next insert (either the entry box is empty or contains =TAB01_ZNo + 1.