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

dir="auto" does not affect the table tag #123

Open
syedkaleem29 opened this issue Sep 6, 2017 · 9 comments
Open

dir="auto" does not affect the table tag #123

syedkaleem29 opened this issue Sep 6, 2017 · 9 comments
Assignees

Comments

@syedkaleem29
Copy link

syedkaleem29 commented Sep 6, 2017

It does not cause the table column itself to be rendered from Right to Left. Because of which the layout in the browser and the PDF differs a lot.

Consider a cell which appears on the left side for English. Now when the pdf language changes to Arabic the cell must come on the right and the text within that should be RTL.

But what actually happens is the cell stays left and the text within the cell is RTL.

i.e., The columns do not run from right to left in tables when the tag is dir="auto"/"rtl"

HTML
image
PDF
image

@syedkaleem29 syedkaleem29 changed the title dir="auto" only changes the text the div to be rtl. dir="auto" does not affect the table tag Sep 6, 2017
@danfickle
Copy link
Owner

Hi @syedkaleem29

This is noted somewhere, probably in the RTL issue. The problem is that with row spans and col spans, the table code is quite complex.

@ieugen
Copy link
Contributor

ieugen commented Dec 4, 2019

Hi, any news on this issue?

@AhmedEzzat12
Copy link

AhmedEzzat12 commented Jun 8, 2020

Hello any news? @danfickle

@danfickle
Copy link
Owner

It seems we need to push this up the priority list.

@AhmedEzzat12
Copy link

AhmedEzzat12 commented Jun 14, 2020

It seems we need to push this up the priority list.

Yes thanks, it's a key feature without it RTL is not really complete it's not only about text.

@danfickle danfickle self-assigned this Jan 3, 2021
@daniil-tagan
Copy link

Hello @danfickle any updates here?

@wahab321
Copy link

wahab321 commented Dec 6, 2021

@danfickle any update about RTL Direction of table?? i need Urgent Can you Please solved in these days

@mike-mike
Copy link

mike-mike commented Dec 6, 2021

Hello @wahab321 . If you are looking for urgent soution you may replace the following code in TableSectionBox.java
Inside setCellWidths function at line 217 write:

sourse:
cell.setX(columnPos[j] + hspacing);

new code for RTL tables only:
Box parent = getTable().getParent();

if(parent != null){
int parentWidth = parent.getContentWidth();
cell.setX(parentWidth - w - (columnPos[j] + hspacing));
}

It solved for me an alignment issue in RTL tables.
I don't know if it is a right solution, but I checked it with simple tables without colspan/rowspan and it works.
At least you can use it until you get a real solution from @danfickle

@wahab321
Copy link

wahab321 commented Dec 12, 2021

thanks it work's for me

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

No branches or pull requests

7 participants