我在这方面做了很多研究(似乎被问了很多),但我尝试过的都没有奏效。我正在使用 jQuery Mobile。这是我的相关代码:
<div style="width:100%; height:220px;">
<table style="width:100%; word-wrap: break-word; table-layout:fixed;">
<tr>
<td height="20"><img height="20" src="images/Products/Carrot.svg"></td>
<td height="20">Carrot</td>
<td height="20">$9.99</td>
</tr>
<tr>
<td height="20"><img height="20" src="images/Products/Raspberry.svg"></td>
<td height="20">Raspberry</td>
<td height="20">$3.49</td>
</tr>
</table>
</div>
大约有 11 个额外的表格行,其中包含文本,但张贴它们是多余的。理想情况下,我想要的(显示在电话屏幕上的)是一个您可以滚动浏览的小表格,并在其下方显示文本。但是,当我尝试将一段放在表格容器外的 div 中时,它会将它放在表格内并随表格滚动。
谢谢!
最佳答案
您可以在第一个 div 上使用 jquery .append() 函数。所以它会在表格之后添加内容
关于jquery - 表格后的文本(不适合放在 div 中)出现在表格中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42806366/