Relative Positioning not working on a Table Row.

北慕城南 提交于 2019-12-13 05:03:12

问题


I have installed and am using IE10 and Chrome. AND I'd like to fixed the top header <tr> in <table>. but below style tag dose not working!!

<tr style="position:relative;top:expression(this.offsetParent.scrollTop);"></tr>

Do anybody have like this experience? If these were bug, I also want another solution to solve this problem. PLZ help me!


回答1:


Relative positioning inside of <table> tags is not supported. Table rows in fact are simply containers for the bits that show in the GUI (the <td> and <th>). You can style the background color of the table row, but very few other visual aspects extend to this element. Because tables already contain positioning by design it's a waste of time trying to overwrite it. You should either use <div> tags and style them with positioning or use the built-in Table CSS styles.

Additionally check out the answer here: Using Position Relative/Absolute within a TD?




回答2:


create some http://fiddle.jshell.net/

so we can understand your code.



来源:https://stackoverflow.com/questions/16515585/relative-positioning-not-working-on-a-table-row

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!