Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有谁知道如何将 AUTO 中的 TR 元素的高度转换为像素或百分比?
您是指在运行时使用 JS 还是在开发阶段?
您总是可以使用 Web Developer 工具栏中提供的标尺来测量它,然后在您的 CSS 中使用该值。
或者,任何使用 JS 计算 tr 元素的高度都应该以像素为单位返回。
使用 jquery 很简单。
myTrHeight = $("#myTr").height()
这将为您提供以像素为单位的高度。