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。