<td>text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2</td>
</tr>
<tr>
<td>text 3</td>
<td>text 4</td>
</tr>
</tbody>
</table>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
table {
width: 100%;
border: 1px solid #f00;
border-collapse: collapse;
}
th, td {
border: 1px solid #f00;
}
td:nth-child(2) {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>head 1</th>
<th>head 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>text 1</td>
<td>text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2</td>
</tr>
<tr>
<td>text 3</td>
<td>text 4</td>
</tr>
</tbody>
</table>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
table {
width: 100%;
border: 1px solid #f00;
border-collapse: collapse;
}
th, td {
border: 1px solid #f00;
}
td:nth-child(2) {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>head 1</th>
<th>head 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>text 1</td>
<td>text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2</td>
</tr>
<tr>
<td>text 3</td>
<td>text 4</td>
</tr>
</tbody>
</table>
</body>
</html>
<td>text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2</td>
</tr>
<tr>
<td>text 3</td>
<td>text 4</td>
</tr>
</tbody>
</table>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
table {
width: 100%;
border: 1px solid #f00;
border-collapse: collapse;
table-layout: fixed;
}
th, td {
border: 1px solid #f00;
}
td:nth-child(2) {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>head 1</th>
<th>head 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>text 1</td>
<td>text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2</td>
</tr>
<tr>
<td>text 3</td>
<td>text 4</td>
</tr>
</tbody>
</table>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
table {
width: 100%;
border: 1px solid #f00;
border-collapse: collapse;
table-layout: fixed;
}
th, td {
border: 1px solid #f00;
}
td:nth-child(2) {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>head 1</th>
<th>head 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>text 1</td>
<td>text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2</td>
</tr>
<tr>
<td>text 3</td>
<td>text 4</td>
</tr>
</tbody>
</table>
</body>
</html>
<td>text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2</td>
</tr>
<tr>
<td>text 3</td>
<td>text 4</td>
</tr>
</tbody>
</table>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
table {
width: 100%;
border: 1px solid #f00;
border-collapse: collapse;
table-layout: fixed;
}
th, td {
border: 1px solid #f00;
}
th:nth-child(1),
td:nth-child(1) {
width: 120px;
/* 百分比或其他單位也可以 width: 20%; */
}
th:nth-child(2),
td:nth-child(2) {
/* 百分比或其他單位也可以 width: 80%; */
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>head 1</th>
<th>head 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>text 1</td>
<td>text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2</td>
</tr>
<tr>
<td>text 3</td>
<td>text 4</td>
</tr>
</tbody>
</table>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
table {
width: 100%;
border: 1px solid #f00;
border-collapse: collapse;
table-layout: fixed;
}
th, td {
border: 1px solid #f00;
}
th:nth-child(1),
td:nth-child(1) {
width: 120px;
/* 百分比或其他單位也可以 width: 20%; */
}
th:nth-child(2),
td:nth-child(2) {
/* 百分比或其他單位也可以 width: 80%; */
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>head 1</th>
<th>head 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>text 1</td>
<td>text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2 text 2</td>
</tr>
<tr>
<td>text 3</td>
<td>text 4</td>
</tr>
</tbody>
</table>
</body>
</html>
在〈[css筆記] 在表格中使用刪節號 css text-overflow: ellipsis〉中有 1 則留言