구글 애드센스 광고가 없을때 해당 영역 숨기게 하려면 보통 아래와 같이 숨깁니다.
<style>
ins.adsbygoogle[data-ad-status="unfilled"] {
display: none !important;
}
</style>
근데 구글 에드센스를 게시판 중간에 넣을려면 아무래도 테이블 태그가 들어갑니다.
https://moonhouse.co.kr/xetip/592403
그러면 에드센스는 사리지는데 태그가 사리지질 않습니다.
이런 경우에 태그 까지 사리지게 하는 방법입니다.
<!--// 목록에 에드센스 출력 -->
<!--@if(in_array($i+1, array($mi->ad1, $mi->ad2, $mi->ad3)) && $mi->list_ads=='Y')-->
<tr class="w100">
<td colspan="10">{$mi->ads_code}</td>
</tr>
<!--@end-->
<style>
ins.adsbygoogle[data-ad-status="unfilled"] {
display: none !important;
}
</style>
{@$i++}
</tr>
위와 같이 게시판 목록 사이에 에드센스를 삽입한다고 치면 tr 칸이 보입니다.
<!--@if(in_array($i+1, array($mi->ad1, $mi->ad2, $mi->ad3)) && $mi->list_ads=='Y')--> <tr class="w100 adsense-container"> <td colspan="10">{$mi->ads_code}</td> </tr> <!--@end--> <!--팁추가--> <style> ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; } tr.adsense-container:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none !important; } </style> {@$i++} </tr>
빨간색 코드 넣어주면 tr 칸도 같이 사라집니다.
tr은 상황에 맞게 div도 되고 li등도 됩니다.
2,3,4줄에 에드센스 출력

3,4칸은 사라진 모습

Tip이 도움이 되었다면 댓글과 평가 부탁합니다.
Tip에 대한 궁금한 점은 댓글로 남겨 주시면 성심껏 답변 드립니다. 
