gpt4 book ai didi

表格上的 CSS 样式居中对齐

转载 作者:行者123 更新时间:2023-11-28 04:42:27 24 4
gpt4 key购买 nike

应用表格样式后,表格居中对齐,这是不应该的...为什么?

我可以为以下页面提供一个 HTML 文件...这是一个截图: enter image description here enter image description here

    table.FLTT { 
clear:both;
width: 100%;
margin: 0 auto;
border-collapse: separate;
border-spacing: 0;
text-decoration: none;
background: #fff;
border:1px solid #dcdcdc;
border-bottom:none;}

table.FLTT th {
background-color: #4D4D4d!important;
color: #FFFFFF!important;
padding: 10px 10px;
text-decoration: none;
transition: 0.0s;
font-size: 13px;
font-weight:normal;
}

table.FLTT td {
padding: 5px 10px;
border-bottom: 1px solid #dcdcdc;
text-decoration: none;
}

table.FLTT tbody > tr:nth-child(odd) > td {
background-color: #cccccc;
}



table.FLTT tbody tr:hover > td {
background-color: #222222;
color: #F0C237;
}

table.FLTT tr {
text-decoration: none;
-webkit-transition:all .5s ease;
-moz-transition:all .5s ease;
-o-transition:all .5s ease;
transition:all .5s ease;}

table.FLTT tr a {
text-decoration: none;
outline:none;
color: #005689;
}

table.FLTT tr:hover a{
background-color: #222222;
color:#F0C237;
text-decoration:underline;
}

table.FLTT tr.cat-list-row1 {
background:#eee}

table.FLTT thead th {
color:#fff!important;
background:#4D4D4d!important;}

最佳答案

在您的 table.FLIT{ } 代码中,您提到了 margin : 0 auto。元素将在父元素中居中,而不是此代码。

在这个 margin 属性中,第一个值表示距顶部的距离,第二个值表示距左边框的距离。所以 auto 将使该元素居中。

您可以删除该属性并设置为

margin : 0px 0px;

或者添加另一个属性

float: left;

关于表格上的 CSS 样式居中对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41141958/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com