문제

다음과 같은 코드가있는 테이블이 있습니다.

<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 엄격한 것을 선호합니다 - 그것들도 작동합니다)
  • 태그에 불필요한 속성이 없습니다. 모두 태그 이름과 클래스로 제어됩니다.

다른 팁

나는 그것이 다음처럼 보이기를 원한다 :

alt text

내가 사용할 때 border="0" 즉, 검은 선을 표시하지 않습니다. 내가 쓰면 <th style="1p solid black>Text</th> 테이블 헤드 주위에 블랙 박스가 있습니다.

사용

스타일 = "테두리 : 1px Solid Black"

그렇다면 테이블 태그에서.

아, 그리고 마지막 셀에 대한 폐쇄가 없습니다.

border="0"

그러나 대신 스타일 시트를 사용해야합니다 ....

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top