gpt4 book ai didi

css - 加载表动态丢失样式规则

转载 作者:行者123 更新时间:2023-11-28 14:15:09 24 4
gpt4 key购买 nike

我正在 jquery 中生成的 div 中加载一个带有表的页面。加载正常,但表格失去了它的样式。我曾尝试在加载页面、登录页面上应用样式,甚至在表格上应用内联样式。内联样式部分起作用,例如背景颜色,但文本不允许我更改字体类型、大小、粗细。

$('<div/>', {
id: 'newdiv',
}).appendTo('body');

$('#newdiv').load('combi/page.with.table.php');

表格被简化了。 tr 或 td 上没有样式。

<table style="font-size:x-large; font-family:'Courier New', Courier, monospace; text-align:right; background:#0F0" width="800" border="1" cellspacing="3" cellpadding="3">
</table>

最佳答案

如果您使用样式表来控制表格的样式,请确保样式表位于相对于加载页面的路径中,而不是正在加载的页面中。

关于css - 加载表动态丢失样式规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9134451/

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