채택완료

최신글 1개만 가져오기 오류

안녕하세요.

테마는 bootstrap5-basic.1.0.1 사용합니다.

테마 index.php 에서 최신글 게시판 1개만 적용을 했는데

크기가 변하지 않습니다.

원래 게시판 크기만큼 키우고 싶은데요,

  <table width="970" border="0" align="center" cellpadding="0" cellspacing="0">

    <tr>

      <td height="150" align="left" valign="top"> <?php echo latest('theme/basic',test, 5, 25); ?>

   </td>

    </tr>

  </table>

이렇게 넣었더니,

넓이가 고정되어 화면이 줄어들어도 가로폭이 줄어들지 않네요,

어디를 수정하면 될까요

2105994875_1688468392.3781.jpg

|

답변 3개 / 댓글 1개

채택된 답변
+20 포인트

반응형 코딩에 있어서 width의 개념중 최대 폭(max-width)을 정하고 기기의 폭이 줄어들 수록 폭의 넓이에 맞추는 코딩을 도입 한다면 <table style="width:100%; max-width:970px; " border="0" align="center" cellpadding="0" cellspacing="0"> 이런식으로 해주시면 좋을 것 같습니다. 물론 basic이란 스킨의 width가 100%로 설정되어있는게 전제조건 입니다

답변에 대한 댓글 1개

한 방에 해결했습니다.

답변 감사합니다.

잘 안 되네요.

소스입니다.

Copy
<?php

/**
 * 커뮤니티 인덱스 페이지
 */
if (!defined('_INDEX_')) {
    define('_INDEX_', true);
}

if (!defined('_GNUBOARD_')) {
    exit;
}

//커뮤니티 미사용시 쇼핑몰
if (G5_COMMUNITY_USE === false) {
    include_once G5_THEME_SHOP_PATH . '/index.php';
    return;
}

include_once G5_THEME_PATH . '/head.php';

?>


<div class="container">
    <div class="row row-cols-sm-1 row-cols-lg-3">
    <!-- 최신글 하나만 
        <div class="col">
            <?php echo latest('theme/basic', 'notice', 10, 90); ?>
        </div>
        <div class="col">
            <?php echo latest('theme/basic', 'qa', 10, 90); ?>
        </div>
    -->

        <div class="col">
                  <style type="text/css">
           .row-cols-lg-3 {width: 100%}
            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td height="150" align="left" valign="top">

            <?php echo latest('theme/basic', 'free', 20, 90); ?>
            
        </td>
    </tr>

  </table>
  </style>
        </div>
    </div>
</div>

<!-- 갤러리 사용 안 함
<div class="container">
    <?php echo latest('theme/gallery', 'gallery', 8, 60); ?>
</div>
-->

<?php
include_once(G5_THEME_PATH . '/tail.php');
 
Copy
<style type="text/css">
.row-cols-lg-3 {width: 100%}    
</style>

이렇게 코드를 추가하시면 될듯 합니다.

답변을 작성하려면 로그인이 필요합니다.