微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在 Web 视图中以表格形式和在移动视图中以列表形式对齐数据?

如何解决如何在 Web 视图中以表格形式和在移动视图中以列表形式对齐数据?

要求:

网络视图

enter image description here

移动视图

enter image description here

问题

使用 Bootstrap 网格来实现所需的设计,但在 Web 视图中,如果我使用一列,则要求图像应有一整列,因此在移动视图中需要左对齐的文本确实如此不向左移动,因为整个图像列已经占用了空间。

进展

网络视图

enter image description here

移动视图

enter image description here

代码

<div className="row " style={{height:"100%"}}>
        <div className="col-4 col-sm-2" style={{paddingTop:"3%"}}>
            {/* {loading ? <BeatLoader loading={loading} size={15} /> : <img className="sub-product-img" src={img} />} */}
            <img className="sub-product-img" src={require("./image")} />
        </div>
        <div className="col-8 col-sm-7"  style={{padding:"2%"}}>
            <div className="row">
                <div className="col-12 col-sm-6">
                    <h4 className="text-left sub-product-heading" style={{fontSize: "16px",fontWeight: "bold"}}>heading</h4>
                </div>
                <div className="col-12 col-sm-6">
                    <h4 className="text-left sub-product-heading-italic" style={{color:"grey"}}>Next Billing Date June 15,2021</h4>
                </div>
                
                <div className="col-12 col-sm-12">
                <h4 className="text-left sub-product-text">Order Number: 35438731</h4>
                     {/* <span className="text-left sub-product-heading">Next Billing Date</span> */}
                </div>
            </div>
            <div className="row">
                <div className="col-12 col-sm-6">
                    <h4 className="text-left sub-product-heading-light" style={{fontWeight:"600"}}>Started On</h4>
                    <h4 className="text-left sub-product-text">May 16,2020</h4>
                </div>
                <div className="col-12 col-sm-3">
                    <h4 className="text-left sub-product-heading-light" style={{fontWeight:"600"}}>Frequency</h4>
                    <h4 className="text-left sub-product-text">Monthly</h4>
                </div>
                <div className="col-12 col-sm-3">
                    <h4 className="text-left sub-product-heading-light" style={{fontWeight:"600"}}>Billing Address</h4>
                    <h4 className="text-left sub-product-text">2401 Warren Rd</h4>
                </div>
            </div>
        </div>
        <div className="col-12 col-sm-3 add-more-Box" style={{ backgroundColor: "#f7f8fa",border: "1px solid #dfdfdf" }}>
        <div className="col-12 col-sm-12" style={{marginTop:"13%"}}>
            <Button
                name="ADD MORE ITEMS"
                className="wine-custom-invert"
                style={{ fontSize: "13px",background: "white",color: "#ff8b43" }}
                onClick={() =>
                    console.log("Getting clicked")
                }
            />
            </div>
            <div className="col-12 col-sm-12" style={{marginTop:"5%",marginBottom:"2%"}}>
            <span style={{ color:"#2490ff",fontWeight: "bold",fontSize:"14px"
        }}>Manage Subscription</span></div>
        </div>
    </div>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?