加载表动态丢失样式规则 [英] Loading table dynamically loses style rules

查看:165
本文介绍了加载表动态丢失样式规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在jquery中的一个生成的div中加载一个带有表的页面。装载很好,但表失去了它的风格。我试图应用样式在加载的页面,着陆页,甚至在表上的内联样式。内联样式部分工作,如背景颜色,但文字不允许我更改字体类型,大小,重量。

I am loading a page with table in a generated div in jquery. The loading goes fine, but the table loses its styles. I have tried to apply styles on the loaded page, on the landing page, and even inline styles on the table. The inline style works partially, like background color, but text doesn't allow me to change font type, size, weight.

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

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

表格已简化。在tr或td上没有样式。

The table is simplified. No styles on tr or 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>


推荐答案

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

If you are using a stylesheet to control the style of the table, make sure the stylesheet is in a path relative to the loaded page and not the page which is being loaded.

这篇关于加载表动态丢失样式规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆