文本与CSS转换属性重叠
当我使用
.right-align {
text-align: right !important;
transform: translateX(-40%);
}
表结构如下所示
<table>
<thead>
<tr>
<th>Bid
</th>
<th>Offer
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div class="right-align">
200
</div>
</td>
<td>
<div class="right-align">
221
</div>
</td>
</tr>
</tbody>
</table>
TD的元素,如下所示,如下所示,
我如何才能使其在标题下进行?
当桌子滚动时,这正在发生
When I am using
.right-align {
text-align: right !important;
transform: translateX(-40%);
}
The Table structure is showing below
<table>
<thead>
<tr>
<th>Bid
</th>
<th>Offer
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div class="right-align">
200
</div>
</td>
<td>
<div class="right-align">
221
</div>
</td>
</tr>
</tbody>
</table>
The td is overlapping the th element as seen below
How can I can make it go under the header ?
This is happening when table is scrolling
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
但是,只要您保持代码紧密,就很难回答该问题的比例和结构。
为什么您决定使用
转换:Translatex(-40%);
规则,但似乎您可能正在尝试覆盖主题来自主题的某些规则,因此您是问题,因此您是问题面对;如果您更新问题并添加更多代码或至少您要实现的目标,那么我可能会更有帮助:)。另外,如果您使用的是框架或主题,则指定哪个。编辑。
我看到了您的更新,您无需在TD元素中添加DIV即可应用类,您可以直接在TD元素中进行。但是,似乎某些CSS规则是重叠的。也许浏览器中结果的屏幕截图可能会有所帮助。
It is very hard to answer the question as it is, however, the table should keep its proportions and structure as long as you keep the code tight:
It is nebulous why you decided to use the
transform: translateX(-40%);
rule in there, but it seems you may be trying to overwrite some rules that come from a theme hence the problem you are facing; If you update your question and add more pieces of code or at least what you are trying to achieve then i could be more helpful :). Also if you are using a framework or theme specify which one.EDIT.
I saw your updates, you don't need to add a div within the td element to apply a class, you can do it directly in the td element. However, it seems that some css rules are overlapping. Maybe a screenshot of the results in a browser could be helpful.