HTML Direction rtl issue

前端 未结 5 769
梦如初夏
梦如初夏 2021-01-17 20:59

I am working on a Multilanguage website , where in a table one of the td needs to be arabic stuff - which we know need to start from right. I tried it in many ways but could

5条回答
  •  生来不讨喜
    2021-01-17 21:34

    Set the dir=rtl attribute on the td element: .... The HTML attribute should be used instead of the corresponding CSS property, since the basic writing direction is not just a presentational suggestion but something that depends on the content.

    You could also set it on an inner element, e.g.

    ...
    . But e.g. code like

    ... won’t work, sice the

    closes the open span element, so the span element has no content and its attributes have no effect.

    Added info: Also make sure that no CSS or HTML setting is overriding the desired effect. For example, align=left on the tr element would set the alignment of all cells to left alignment, and the dir=rtl attribute won’t “win” it on its own. (If there is such an attribute and you can’t remove it, set the cell alignment explicitly, using align=right in HTML.)

提交回复
热议问题