Why do table fields go wrong when it is dir = "rtl"?

when I change the page direction to rtl, the table fields become wrong, as in this figure enter image description here

but when I just remove the attribute dirfrom the page, everything becomes correct, as in enter image description here

CSS

table,td,tr {
    border: 2px solid black;
    padding:0px;
}

HTML

<body>
    <table>
        <tr> <td></td><td></td> </tr>
        <tr> <td></td><td></td> </tr>
    </table>
</body>

this happens in Firefox, but in Chrome the table is true in both directions!

How to solve this problem?

EDIT:

I just reported a new bug in Bugzilla today (3 years after the question: D), here is the link https://bugzilla.mozilla.org/show_bug.cgi?id=1580346

+4
source share
1 answer

As the comments say, this is a mistake.

However.

border tr. , - tr, .
, ,tr CSS.
, - LTR. RTL. , .

table,td {
  border: 2px solid black;
  padding: 0px;
}
<body dir="rtl">
  <table>
    <tr> <td>test</td><td>test</td> </tr>
    <tr> <td>test</td><td>test</td> </tr>
  </table>
</body>
Hide result
+2

Source: https://habr.com/ru/post/1650469/


All Articles