openhtmltopdf
openhtmltopdf copied to clipboard
dir="auto" does not affect the table tag
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
PDF
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.
Hi, any news on this issue?
Hello any news? @danfickle
It seems we need to push this up the priority list.
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.
Hello @danfickle any updates here?
@danfickle any update about RTL Direction of table?? i need Urgent Can you Please solved in these days
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
thanks it work's for me