Skip to main content
added 64 characters in body
Source Link

Given the following org-table:

| col1 | col2 | col3 | col4 |
|------+------+------+------|
|   11 |   12 | A    |   14 |
|   21 |   22 | A    |   24 |
|   31 |   32 | A    |   34 |
|   41 |   42 | B    |   44 |
|   51 |   52 | C    |   54 |
|   61 |   62 | C    |   64 |
|   71 |   72 | D    |   74 |
|------+------+------+------|

I'd like to add (programmaticallyeither programmatically or using #+TBLFM) an hline each time the value of col3 changes. Here's the final result I'd like to obtain:

| col1 | col2 | col3 | col4 |
|------+------+------+------|
|   11 |   12 | A    |   14 |
|   21 |   22 | A    |   24 |
|   31 |   32 | A    |   34 |
|------+------+------+------|
|   41 |   42 | B    |   44 |
|------+------+------+------|
|   51 |   52 | C    |   54 |
|   61 |   62 | C    |   64 |
|------+------+------+------|
|   71 |   72 | D    |   74 |
|------+------+------+------|

Any ideas as to how this could be done ?

Given the following org-table:

| col1 | col2 | col3 | col4 |
|------+------+------+------|
|   11 |   12 | A    |   14 |
|   21 |   22 | A    |   24 |
|   31 |   32 | A    |   34 |
|   41 |   42 | B    |   44 |
|   51 |   52 | C    |   54 |
|   61 |   62 | C    |   64 |
|   71 |   72 | D    |   74 |
|------+------+------+------|

I'd like to add (programmatically) an hline each time the value of col3 changes. Here's the final result I'd like to obtain:

| col1 | col2 | col3 | col4 |
|------+------+------+------|
|   11 |   12 | A    |   14 |
|   21 |   22 | A    |   24 |
|   31 |   32 | A    |   34 |
|------+------+------+------|
|   41 |   42 | B    |   44 |
|------+------+------+------|
|   51 |   52 | C    |   54 |
|   61 |   62 | C    |   64 |
|------+------+------+------|
|   71 |   72 | D    |   74 |
|------+------+------+------|

Given the following org-table:

| col1 | col2 | col3 | col4 |
|------+------+------+------|
|   11 |   12 | A    |   14 |
|   21 |   22 | A    |   24 |
|   31 |   32 | A    |   34 |
|   41 |   42 | B    |   44 |
|   51 |   52 | C    |   54 |
|   61 |   62 | C    |   64 |
|   71 |   72 | D    |   74 |
|------+------+------+------|

I'd like to add (either programmatically or using #+TBLFM) an hline each time the value of col3 changes. Here's the final result I'd like to obtain:

| col1 | col2 | col3 | col4 |
|------+------+------+------|
|   11 |   12 | A    |   14 |
|   21 |   22 | A    |   24 |
|   31 |   32 | A    |   34 |
|------+------+------+------|
|   41 |   42 | B    |   44 |
|------+------+------+------|
|   51 |   52 | C    |   54 |
|   61 |   62 | C    |   64 |
|------+------+------+------|
|   71 |   72 | D    |   74 |
|------+------+------+------|

Any ideas as to how this could be done ?

edited tags
Link
Drew
  • 79.1k
  • 10
  • 123
  • 257
Source Link

org-table: add hline based on change in column values

Given the following org-table:

| col1 | col2 | col3 | col4 |
|------+------+------+------|
|   11 |   12 | A    |   14 |
|   21 |   22 | A    |   24 |
|   31 |   32 | A    |   34 |
|   41 |   42 | B    |   44 |
|   51 |   52 | C    |   54 |
|   61 |   62 | C    |   64 |
|   71 |   72 | D    |   74 |
|------+------+------+------|

I'd like to add (programmatically) an hline each time the value of col3 changes. Here's the final result I'd like to obtain:

| col1 | col2 | col3 | col4 |
|------+------+------+------|
|   11 |   12 | A    |   14 |
|   21 |   22 | A    |   24 |
|   31 |   32 | A    |   34 |
|------+------+------+------|
|   41 |   42 | B    |   44 |
|------+------+------+------|
|   51 |   52 | C    |   54 |
|   61 |   62 | C    |   64 |
|------+------+------+------|
|   71 |   72 | D    |   74 |
|------+------+------+------|