Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 无法在表格单元格内集中对齐图标_Html_Css - Fatal编程技术网

Html 无法在表格单元格内集中对齐图标

Html 无法在表格单元格内集中对齐图标,html,css,Html,Css,我遇到了一个简单的问题,即在表格单元格中集中对齐图像。CSS Margin:auto由于某些原因在支付图标和奖金提供图标上不起作用。你能告诉我保证金有什么问题吗:自动?谢谢 <table class="payment-table"> <tr class="payment-table-row payment-table-header"> <th class="payment-table-heade

我遇到了一个简单的问题,即在表格单元格中集中对齐图像。CSS Margin:auto由于某些原因在支付图标和奖金提供图标上不起作用。你能告诉我保证金有什么问题吗:自动?谢谢

        <table class="payment-table">
            <tr class="payment-table-row payment-table-header">
                <th class="payment-table-header-item">Payment System</th>
                <th class="payment-table-header-item">Limits</th>
                <th class="payment-table-header-item">Commission (%)</th>
                <th class="payment-table-header-item">Processing Time</th>
                <th class="payment-table-header-item">Bonus Offered</th>
            </tr>   

            <tr class="payment-table-row">
                <td><img src="ico/neteller.png" class="payment-icon"></td>
                <td class="deposit-limits table-data">£10 - £ 2000</td>
                <td class="deposit-commission table-data">3 % +  £ 1.55</td>
                <td class="deposit-processing table-data">Up to 3 Bank Days</td>
                <td><img src="ico/yes.png" class="bonus-offered-icon"></td>
            </tr>

            <tr class="payment-table-row">
                <td><img src="ico/neteller.png" class="payment-icon"></td>
                <td class="deposit-limits table-data">£10 - £ 2000</td>
                <td class="deposit-commission table-data">3 % + £ 1.55</td>
                <td class="deposit-processing table-data">Up to 3 Bank Days</td>
                <td><img src="ico/yes.png" class="bonus-offered-icon"></td>
            </tr>
        </table>
这就是你需要的

您不必使用
margin:auto使中心对齐。您只需要使用
文本对齐:居中
td

。付款表{
宽度:80%;
边框:1px纯黑;
}
.付款表标题项{
边框:1px纯红;
}
.付款表第td行{
宽度:15%;/*根据需要定制td的宽度*/
边框:1px实心青色;
文本对齐:居中;/*这是对齐居中所需的内容*/
}
.付款图标{
保证金:自动;
宽度:40px;
}
.提供的奖金图标{
宽度:20px;
保证金:自动;
}
.表格数据{
最大宽度:30px;
文本对齐:居中;
}

支付系统
限制
佣金(%)
处理时间
奖金
£10 - £ 2000
3 % + £ 1.55
最多3个银行工作日
£10 - £ 2000
3 % + £ 1.55
最多3个银行工作日

页边距:auto
令人困惑。它不仅仅意味着“以元素为中心”。对于不同的元素,它的行为不同。一个

£10 - £ 2000
3 % +  £ 1.55
最多3个银行工作日
£10 - £ 2000
3 % + £ 1.55
最多3个银行工作日
.payment-table{
    width: 60%;
}

.payment-icon{
    margin: auto;
    width: 40px;
}

.bonus-offered-icon{
    width: 20px;
    margin:auto;
}

.table-data{
    max-width: 30px;
    text-align: center;
}