将html转为list,如何将HTML表格转换为Internet Explorer中的列表

I have a dynamically generated table in my page, which was generated by a 3rd party source (its an MLS feed) with 10 rows, 5 columns. I can't request much else. I want to display it as ONE column, hence, like a list. I have managed to do this on Firefox, Safari, and Chrome, but when I work with it in IE, the two effects I get are: each TD element in each row overlaps like a hand of cards in poker while maintaining the TR spacing - OR - it will stack the TDs AND the TRs all into one pile of IE crap. Finally, nothing I do in CSS seems to change my table's width or TD width. o.O. Commencing hair removal tactics.

我的页面中有一个动态生成的表,它由第3方源(它的MLS提要)生成,包含10行,5列。我不能要求更多。我想将它显示为一列,因此,就像一个列表。我已经设法在Firefox,Safari和Chrome上做到了这一点,但是当我在IE中使用它时,我得到的两个效果是:每行中的每个TD元素都像扑克中的一副牌一样重叠,同时保持TR间距 - 或者 - 它将TD和TR全部堆叠成一堆IE垃圾。最后,我在CSS中所做的一切似乎都改变了我的表的宽度或TD宽度。 o.O.开始脱毛战术。

Page example: http://www.vdbestates.com/beta/residential.html (view in Firefox and IE for best illustration)

页面示例:http://www.vdbestates.com/beta/residential.html(在Firefox和IE中查看以获得最佳插图)

Html:

HTML:

...

I am using jQuery to dynamically assign new "top" values to the TDs in the other browsers, using a for loop, multiplying the index by the TD height:

我正在使用jQuery动态地为其他浏览器中的TD分配新的“顶部”值,使用for循环,将索引乘以TD高度:

var tCell;

for(var i = 0; i < size; i++) {

tCell = $('td.IDX-showcaseDetails').eq(i);

$(tCell).attr('style', 'top:' + (i * 250) + 'px;');

}

CSS: (all browsers)

CSS :(所有浏览器)

table[id^=IDX-showcaseWrapper] {

position:relative;

min-height:1200px !important;

padding-bottom:20px;

z-index:1;

display:block;

}

table[id^=IDX-showcaseWrapper] tr {

position:relative;

}

.IDX-showcaseDetails {

display:list-item !important;

list-style-type:none;

width:480px;

height:275px;

position:relative;

clear:both;

border-bottom:1px solid #5c4a57;

margin-bottom:15px;

padding:0px;

z-index:1;

}

2 个解决方案

#1

2

Why not read your data out of the table, re-write it into a list, then remove the table? Messing around with CSS to emulate this will surely drive you mad. Use JavaScript instead.

为什么不从表中读取数据,将其重新写入列表,然后删除表?乱搞CSS来模仿这肯定会让你发疯。请改用JavaScript。

#2

1

I'm not quite shure i understand you problem but how about writing a new list and not messing with the old one? Iterate to the old one, fetching the values and print the new html.

我不是很害羞我理解你的问题,但是如何写一个新的清单而不是弄乱旧的清单呢?迭代旧的,获取值并打印新的html。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值