gpt4 book ai didi

css - 文本溢出不适用于 HTML5

转载 作者:可可西里 更新时间:2023-11-01 13:36:13 26 4
gpt4 key购买 nike

<分区>

以下代码可在 chrome 上正常运行。但不是在 Firefox 或 IE 上。添加<!DOCTYPE html>标记此代码,导致它也不适用于 chrome。有text-overflow被弃用了还是什么?如何使其与所有浏览器和 HTML5 兼容?

<head>

<style type='text/css'>
table {
display: block;
margin: 30px 0 auto 0;
width: 100%;
max-width: 1300px;
text-align: left;
white-space: nowrap;
border-collapse: collapse;
z-index: -1;
table-layout:fixed;
}

td {
overflow: hidden;
white-space: nowrap;
word-wrap:break-word;
text-overflow:ellipsis;
border: 1px solid black;
}
</style>
</head>
<body>
<table>
<tr>
<th style="width: 18%;">Col 1</th>
<th style="width: 12%;">Col 2</th>
<th style="width: 13%;">Col 3</th>
<th style="width: 7%">Col 4</th>
<th style="width: 7%">Col 5</th>
<th style="width: 6%">Col 6</th>
<th style="width: 5%">Col 7</th>
<th style="width: 13%">Col 8</th>
<th style="width: 16%">Col 9</th>
<th style="width: 3%">Col 10</th>
</tr>
<tr>
<td>Some</td>
<td>Data</td>
<td>Stuff</td>
<td>foo</td>
<td>bar</td>
<td>etc</td>
<td>whatever</td>
<td>stuff</td>
<td>Alotofdataikkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk</td>
<td>Yes</td>
</tr>
</table>

</body>

这就是我想要的。 enter image description here

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com