Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table column alignment error #4500

Open
Alphastrick opened this issue Oct 11, 2023 · 1 comment
Open

Table column alignment error #4500

Alphastrick opened this issue Oct 11, 2023 · 1 comment
Labels
Milestone

Comments

@Alphastrick
Copy link

Using asciidoctor, the following code is expected to generate a table with four rows. The first column is expected to be aligned to the left, the second centered and the third to the right. The third and the fourth row contain a cell spanning two cells each.

[cols="1,^1,>1",options="header"]
|===

| Column 1
| Column 2
| Column 3

| Test 1.1
| Test 2.1
| Test 3.1

| Test 1.2
2+| Test 2.2

2+| Test 1.3
| Test 3.3

|===

However, the following result is rendered.

Actual
grafik

Expected
grafik

@mojavelinux
Copy link
Member

This is a known limitation of Asciidoctor and has to do with how it associates colspecs to columns when there are rowspans and colspans (it basically doesn't see them). We're not ruling out a solution, but it is already covered by #989 (then follow all the related issues from there). It also happens to apply for colspans too. I'll keep this issue open since it's all connected.

The workaround is to apply the formatting directly to the table cell in question.

[cols="1,^1,>1"]
|===
| Column 1 | Column 2 | Column 3

| Test 1.1
| Test 2.1
| Test 3.1

| Test 1.2
2+| Test 2.2

2+| Test 1.3
>| Test 3.3
|===

For some context, the implementation of colspec mapping in Asciidoctor is admittedly naive, but to fix it requires a substantial overhaul of the design and logic. I don't have the time to do that at the moment.

@mojavelinux mojavelinux added this to the unscheduled milestone Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants