이것이 가능한지 모르겠지만 ... 특정 모양을 갖기 위해 css로 테이블을 포맷하려고합니다. 이것은 내 고객이 업데이트 할 워드 프레스 사이트입니다. 문제는 그녀가 특정 형식의 테이블을 복사 / 붙여 넣기 할 것이고, 추가 작업을하지 않고도 테이블에 해당 형식이 있기를 원한다는 것입니다. 이것이 내가 지금까지 가지고있는 것입니다.
굵은 텍스트가 있는 셀에는 아래에 점선이 표시되지 않도록합니다. 지금은 다음과 같이 점선을 추가하기 위해 tr 라인을 포맷하고 있습니다.
HTML
<table class="dotted" border="0" width="450" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td colspan="2"><strong>Argento</strong></td>
</tr>
<tr>
<td>Cake Box Lady</td>
<td style="text-align: right;">Postcard from Morocco</td>
</tr>
<tr>
<td colspan="2"><strong>Bellini</strong></td>
</tr>
.....
CSS
.dotted tr:nth-child(even) {
text-decoration: none;
border-bottom: 1px white dotted;
}
.dotted tr:nth-child(odd) {
text-decoration: none;
border-bottom: 1px white dotted;
}
굵은 텍스트가있는 각각에 대해 사용자 정의 클래스 태그를 추가하지 않고도이를 수행 할 수있는 방법이 있습니까?
이것이 내가 원하는 모습이지만 이것은 모두 수동으로 수행됩니다 ... 그게 내가 피하려고하는 것입니다.
추신 : 때로는 테이블에 굵은 글자 아래에 1 개 이상의 '데이터'가있을 수 있으므로 '제목'과 '연극'에 관해서는 항상 이상하고 짝수 라인이 아닙니다. (뮤지컬 플레이 사이트)
-감사
@Manoj Kumar 그래 대담한 항목은 항상 colspan 2 아래에 있습니다.
위의 주석을 언급 했으므로 CSS 해킹이 있습니다.
td
대신에 점선 테두리 만 갖도록 CSS를 변경하십시오 tr
.colspan=2
테두리가 없도록 속성 선택기로 요소를 타겟팅합니다 .table {
background: gray;
}
.dotted td:nth-child(even) {
text-decoration: none;
border-bottom: 1px white dotted;
}
.dotted td:nth-child(odd) {
text-decoration: none;
border-bottom: 1px white dotted;
}
.dotted td[colspan="2"] { /* Attribute selector */
border: 0 none;
}
<table class="dotted" border="0" width="450" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td colspan="2"><strong>Argento</strong>
</td>
</tr>
<tr>
<td>Cake Box Lady</td>
<td style="text-align: right;">Postcard from Morocco</td>
</tr>
<tr>
<td colspan="2"><strong>Bellini</strong>
</td>
</tr>
<tr>
<td colspan="2"><strong>Argento</strong>
</td>
</tr>
<tr>
<td>Cake Box Lady</td>
<td style="text-align: right;">Postcard from Morocco</td>
</tr>
<tr>
<td colspan="2"><strong>Bellini</strong>
</td>
</tr>
<tr>
<td colspan="2"><strong>Argento</strong>
</td>
</tr>
<tr>
<td>Cake Box Lady</td>
<td style="text-align: right;">Postcard from Morocco</td>
</tr>
<tr>
<td colspan="2"><strong>Bellini</strong>
</td>
</tr>
<tr>
<td colspan="2"><strong>Argento</strong>
</td>
</tr>
<tr>
<td>Cake Box Lady</td>
<td style="text-align: right;">Postcard from Morocco</td>
</tr>
<tr>
<td>Cake Box Lady</td>
<td style="text-align: right;">Postcard from Morocco</td>
</tr>
<tr>
<td>Cake Box Lady</td>
<td style="text-align: right;">Postcard from Morocco</td>
</tr>
<tr>
<td colspan="2"><strong>Bellini</strong>
</td>
</tr>
</tbody>
</table>
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다