테이블은 오페라와는 다른 것으로 나타났습니다
-
20-08-2019 - |
문제
다음과 같은 코드가있는 테이블이 있습니다.
<table cellpadding="6" rules="groups" frame="no">
<thead>
<tr><th>Date</th><th>Length</th><th>Time</th></tr>
</thead>
<tbody>
<tr><td>31. January1</td><td>28 km</td><td>3 hours</tr>
</tbody></table>
문제는 즉 테이블에 프레임과 테이블 보더 = 1이 있다는 것입니다.
해결책
이 시도:
<!DOCTYPE html>
<html>
<head>
<title>Example:Table with Header Underline Border</title>
<style type="text/css">
table.groups
{
border-collapse: collapse;
}
table.groups thead th
{
border-bottom: solid 1px black;
}
table.groups th,
table.groups td
{
padding: 6px;
}
</style>
</head>
<body>
<table class="groups">
<thead>
<tr><th>Date</th><th>Length</th><th>Time</th></tr>
</thead>
<tbody>
<tr><td>31. January1</td><td>28 km</td><td>3 hours</td></tr>
</tbody>
</table>
</body>
</html>
주목해야 할 몇 가지 구체적인 사항 :
- DocType를 사용하여 기발한 모드를 방지합니다.
(이것은 html5 doctype입니다 - 어떤 사람들은 더 말이 많은 xhtml 또는 html4 엄격한 것을 선호합니다 - 그것들도 작동합니다) - 태그에 불필요한 속성이 없습니다. 모두 태그 이름과 클래스로 제어됩니다.
제휴하지 않습니다 StackOverflow