【问题标题】:Reverse cells in a table row in html在html中的表格行中反转单元格
【发布时间】:2019-11-20 01:09:53
【问题描述】:

我想用 HTML 属性或 CSS 反转 HTML 表格中行单元格的顺序。

我找到了 'reversed' 属性,但它仅适用于 HTML 列表并且仅反转列表的计数。

[table]
    [row]
        [cell 1] [cell 2] [cell 3] [cell 4]
    [/row]
[/table]

...applying reversal....

[table]
    [row]
        [cell 4] [cell 3] [cell 2] [cell 1]
    [/row]
[/table]

【问题讨论】:

    标签: html html-table cell reverse


    【解决方案1】:

    您可以滥用direction 属性来获得此效果:

    <table>
    <tr><td>1</td><td>2</td></tr>
    <tr><td>3</td><td>4</td></tr>
    </table>
    
    <br>
    
    <table style="direction:rtl">
    <tr><td>1</td><td>2</td></tr>
    <tr><td>3</td><td>4</td></tr>
    </table>

    【讨论】:

    • 我不明白你的评论
    • 这种风格(方向)适用于所有浏览器?
    • 可能,但我不确定
    猜你喜欢
    • 1970-01-01
    • 2019-06-22
    • 2010-11-12
    • 2014-07-30
    • 2018-12-21
    • 1970-01-01
    • 1970-01-01
    • 2014-07-20
    • 2021-01-29
    相关资源
    最近更新 更多