gpt4 book ai didi

css - 具有嵌套表结构的网站 : How to remove padding and margin only for the main structure and not for a table inside?

转载 作者:太空宇宙 更新时间:2023-11-04 11:28:39 24 4
gpt4 key购买 nike

我在一个使用表格结构的网站上工作,无法访问它们并用 div 替换。我已经研究过使用 jquery 删除和替换这些表,但现在这将是最后的解决方案......如果可能的话

它们带有同样不可访问的默认样式(带有填充和边距)

我还在 Netsuite 上为这个元素使用 foundation 5,所以我覆盖了 2 个样式表。

我正在使用此 CSS 去除 foundation.css 附带的表格的边距和填充

   table, tr, td, table, table tr.even, table tr.alt, table tr:nth-of-type(even), table, table tr.odd, table tr.alt, table tr:nth-of-type(odd) {
padding: 0px !important;
margin: 0px !important;
}

它基本上做得很好,但我确实需要更具体一点,因为购物车也使用表格,它会去除所有边距和填充,之后不可能添加它们,因为它不会占用它们。

这是我需要删除边距和填充的网站主体结构,但我希望它在最后一个表格结构处停止,以便我可以设置将使用表格的内容的样式。

感谢您的帮助!我希望我已经足够清楚了;)

<div id='div__body' style="margin: 0px;  margin-top: 3px;">
<table border='0' cellspacing='0' cellpadding='0' width='100%' id='__enclosingtable'>
<tr>
<td valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr class='portletHandle' id='handle_welcomeMainPortlet' >
<td width='100%' height=0 align='left' valign='top'>
<table border=0 cellspacing=0 cellpadding=0 width='100%'>
<tr>
<td width=0 height=0 align='left' valign='top' style='display:none'>
</td>
</tr>
<tr>


<!-- MAIN CONTENT WITH DIVS OR TABLES GOES HERE -->



</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>

最佳答案

看看能不能帮到你:

table{
border:1px solid #bbb;
padding:0px;
margin:0px;
}

table table{
border-color:red;
padding:10px;
margin:10px;
}

https://jsfiddle.net/AliAdravi/t5k7sa0q/

关于css - 具有嵌套表结构的网站 : How to remove padding and margin only for the main structure and not for a table inside?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32189289/

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