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 align is not honored #299

Closed
kongou-ae opened this issue Aug 4, 2015 · 4 comments
Closed

Table align is not honored #299

kongou-ae opened this issue Aug 4, 2015 · 4 comments
Assignees

Comments

@kongou-ae
Copy link

The "align" attributes of table is not supported?

My environment is "Asciidoctor PDF 1.5.0.alpha.9 using Asciidoctor 1.5.2". This Asciidoctor PDF changes this adoc into this image.

[.text-center]
.ほげほげ一覧
[align="right",width="50",cols="<1,^1,^1",options="header,strong"]
|=======================
|Col 1|Col 2      |Col 3
|1    |Item 1     |a
|2    |Item 2     |b
|3    |Item 3     |c
|=======================

ああああ

[.text-center]
.ほげほげ
[align="center",width="50",options="header"]
|=======================
|Col 1|Col 2      |Col 3
|1    |Item 1     |a
|2    |Item 2     |b
|3    |Item 3     |c
|4    |Item 4     |d
|=======================

If not support, is it possible to center the table in the page in a different way?

@mojavelinux
Copy link
Member

I guess we hadn't thought of it yet because we always had tables that are 100%. Prawn Table supports it, so we just need to implement it.

@mojavelinux mojavelinux added this to the v1.5.0.beta.1 milestone Aug 4, 2015
@mojavelinux mojavelinux self-assigned this Aug 4, 2015
@mojavelinux
Copy link
Member

It will be necessary to use the role "left", "center" or "right" to be consistent with how the HTML works.

[.center, width=50%]
|===
|Column A |Column B

|A1
|B1

|A2
|B2
|===

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Aug 6, 2015
@mojavelinux
Copy link
Member

I decided to implement the align attribute as well as an alternative (though this doesn't currently work in the HTML converter).

mojavelinux added a commit that referenced this issue Aug 7, 2015
resolves #299 honor table alignment (via align attribute or role)
@kongou-ae
Copy link
Author

Thanks. Using .center , I can place the table in the center.

.ほげほげ一覧
[.right,width="50",cols="<1,^1,^1",options="header,strong"]
|=======================
|Col 1|Col 2      |Col 3
|1    |Item 1     |a
|2    |Item 2     |b
|3    |Item 3     |c
|=======================

ああああ

.ほげほげ
[.center,width="50",options="header"]
|=======================
|Col 1|Col 2      |Col 3
|1    |Item 1     |a
|2    |Item 2     |b
|3    |Item 3     |c
|4    |Item 4     |d
|=======================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants