如何覆盖蚂蚁设计中的样式?

发布于 2025-01-19 07:39:36 字数 1648 浏览 2 评论 0原文

因此,我有一张来自Ant Design的桌子。它在桌子上增加了填充或边距,因此我无法让桌子从左侧展开,因为它被蚂蚁设计CSS阻挡,桌子上有一个css of table布局:自动,我无法摆脱它。我尝试重置CSS Meyers并尝试了边距:0!在各种元素上很重要,但是该死的填充不会消失。这是一些可以查看的代码。谢谢。

    background-size: cover; 
    background-repeat: no-repeat;
    height:180vh;
    margin-top:4%;

}

.wine-heading{
    font-size:4rem;
    text-align:center;
    font-family:Italianno;
    color:#f0ead6;
    

}

.ant-table-cell{
    font-size:1.5rem;
    font-family:Italiano;
    text-align:center;
    color:white;
    text-align: center;
    margin-left:auto;
    margin-right: auto;
    
}

.ant-table-thead .ant-table-cell {
    color:beige;
    text-shadow:0px 1px 1px black;
    display:flex column;
    justify-content:space-between;


}

table{
    margin:0 !important;
    display:flex column;
    justify-content:space-around !important;
}


.ant-table-content table{
    margin:0 !important;
}




.ant-table-container{
    margin:0;
    width:100%;
}

.ant-table-tbody{
    display:flex column;
    justify-content:space-around;
    
}

.ant-table-tbody{
    padding: 0 !important;
  }
  .ant-table-tbody  > tr > td{
    padding: 0 !important;
  }

.ant-table{
    margin:0 !important;
}

winelist.js
return (
    <>
      <section
        className="wine-section"
        style={{
          backgroundImage: `url(${wine})`,
        }}
      >
        <animated.div style={props}>
          <h4 className="wine-heading">Carmellos Wine List</h4>

          <Table dataSource={dataSource} columns={columns} pagination={false} />
        </animated.div>
      </section>
    </>
  );

So I have a table that is from ant design. it is adding padding or margin to the table so I cant get the table to expand from the left side because it is blocked by the ant design css, the table has a inline css of table layout :auto And I cant get rid of it. I have tried css meyers reset and tried margin:0 !important on various elements but that damn padding wont go away. Here is some code to look at. Thanks.

    background-size: cover; 
    background-repeat: no-repeat;
    height:180vh;
    margin-top:4%;

}

.wine-heading{
    font-size:4rem;
    text-align:center;
    font-family:Italianno;
    color:#f0ead6;
    

}

.ant-table-cell{
    font-size:1.5rem;
    font-family:Italiano;
    text-align:center;
    color:white;
    text-align: center;
    margin-left:auto;
    margin-right: auto;
    
}

.ant-table-thead .ant-table-cell {
    color:beige;
    text-shadow:0px 1px 1px black;
    display:flex column;
    justify-content:space-between;


}

table{
    margin:0 !important;
    display:flex column;
    justify-content:space-around !important;
}


.ant-table-content table{
    margin:0 !important;
}




.ant-table-container{
    margin:0;
    width:100%;
}

.ant-table-tbody{
    display:flex column;
    justify-content:space-around;
    
}

.ant-table-tbody{
    padding: 0 !important;
  }
  .ant-table-tbody  > tr > td{
    padding: 0 !important;
  }

.ant-table{
    margin:0 !important;
}

winelist.js
return (
    <>
      <section
        className="wine-section"
        style={{
          backgroundImage: `url(${wine})`,
        }}
      >
        <animated.div style={props}>
          <h4 className="wine-heading">Carmellos Wine List</h4>

          <Table dataSource={dataSource} columns={columns} pagination={false} />
        </animated.div>
      </section>
    </>
  );

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

山有枢 2025-01-26 07:39:36

你的意思是覆盖 antd 表中的 css 吗?
也许几天前我遇到了同样的问题。
你可以导入一个 winelist.css :
在 chrome 中找到 htmldom 。然后你就可以得到CSS选择器,然后你可以用你自己的在此处输入图像描述

[![在此处输入图像描述]

在这里你可以尝试覆盖样式,填充位于

u mean override css in antd table?
maybe i meet the same problem few days ago.
u can import a winelist.css :
find the htmldom at chrome . and then u can get the css selector ,then u can override the css by your ownenter image description here

[![enter image description here]
enter image description here

at here u can try to override the style,the padding is at a in the

三岁铭 2025-01-26 07:39:36

从开发人员工具中找到具有填充或边距的类的确切表格。

在您的项目全局CSS文件中覆盖同一类,并添加填充,保证金为0!

from developer tool find the exact table div with class which have padding or margin.

override the same class in the your project global css file and add padding,margin 0 with !important and I hope it will work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文