Har*_*rup 8 html css html-table
我使用表来显示一组数据,我的HTML代码在这里...
<table border="1" cellspacing="0" cellpadding="0" style="width: 780px;">
<tbody>
<tr>
<td style="width: 780px; height: 25px;">
<pre width='100' style='width: 780px; word-wrap: break-word;'>
the data goes here.....
</pre>
</td>
</tr>
<tr>
<td style="width: 780px; height: 25px;">
<pre width='100' style='width: 780px; word-wrap: break-word;'>
the data goes here.....
</pre>
</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
这个表在firefox,safari和IE8中运行正常.但问题出现在IE7,IE6中.当桌子扩展并离开屏幕时(即在x轴向右侧扩展)....有没有修复它的黑客?
IETester中IE6的屏幕截图:

小智 19
使用下面的CSS,这可以防止您的表超出您定义的最大大小:
table{
table-layout:fixed;
}
Run Code Online (Sandbox Code Playgroud)
问题已解决,因为我使用的代码为
<table border="1" cellspacing="0" cellpadding="0" width="780" style="table-layout:fixed">
<col width="780">
<tbody>
<tr>
<td style="width: 780px; height: 25px; overflow:hidden;">
<pre width='100' style='width: 780px; word-wrap: break-word;'>
the data goes here.....
</pre>
</td>
</tr>
<tr>
<td style="width: 780px; height: 25px; overflow:hidden;">
<pre width='100' style='width: 780px; word-wrap: break-word;'>
the data goes here.....
</pre>
</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
上面的代码有三处变化......
我从下面给出的链接中得到了此信息,请大家查看...“ http://www.tek-tips.com/faqs.cfm?fid=4499 ”,因此我的问题得到了解决。
| 归档时间: |
|
| 查看次数: |
23588 次 |
| 最近记录: |