0
다른 표 안에 HTML 표가 있습니다. 두 테이블의 스타일은 CSS에서 정의됩니다. 테두리 색이 다른 안쪽과 바깥 쪽 테이블을 원합니다. 그러나 어떻게 든 내부 테이블은 외부 테이블의 테두리 색을 취하고 있습니다. 아래 코드는 -CSS를 사용하여 테두리 색상이 다른 HTML 외부 및 내부 표
HTML :
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="common.css">
</head>
<body>
<table width="100%" class="OuterTableStyle1"><tr><td>
<table width="100%" class="CommonTableStyle1" >
<tr>
<th>Title 1</th>
<th>Title 2</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</table>
</td></tr></table>
</body>
</html>
CSS :
/*======= Start : Common data table style =========*/
table.CommonTableStyle1 td
{
vertical-align:middle;
padding:5px;
font-size:11px;
font-family:Arial;
font-weight:normal;
color:#000000;
}
table.CommonTableStyle1 th, table.CommonTableStyle1 td
{
border: 1px solid #525272 ;
}
table.CommonTableStyle1
{
border-collapse:collapse;
}
/*======= End : Common data table style =========*/
/*=== Start : This table is used as border of another scrollable table ===*/
table.OuterTableStyle1
{
border-collapse:collapse;
}
table.OuterTableStyle1 th, table.OuterTableStyle1 td
{
border: 1px solid red;
}
/*=== End : This table is used as border of another scrollable table ===*/
이 도와주세요.
[편집 CSS]
/*======= Start : Common data table style =========*/
table.CommonTableStyle1 td
{
vertical-align:middle;
padding:5px;
font-size:11px;
font-family:Arial;
font-weight:normal;
color:#000000;
}
table.CommonTableStyle1 th, table.CommonTableStyle1 td
{
border: 1px solid #525272 ;
}
table.CommonTableStyle1
{
border-collapse:collapse;
}
/*======= End : Common data table style =========*/
/*=== Start : This table is used as border of another scrollable table ===*/
table.OuterTableStyle1
{
border-collapse:collapse;
border: 1px solid red;
}
/*=== End : This table is used as border of another scrollable table ===*/
안녕하세요. Mr. Lister, 당신의 대답이 저에게 효과적이었습니다. 하지만 내 질문에 표시된대로 코드를 변경하면 다시 똑같은 일이 발생합니다. 이 문제를 해결하도록 도와 주시겠습니까? – Kartic
수정 된 CSS 섹션의 코드가 작동했습니다. 내 실수를 지적 해 주신 Mr. Lister에게 감사드립니다. – Kartic