창을 줄여도 가운데로 화면정렬하려면 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

창을 줄여도 가운데로 화면정렬하려면 정보

창을 줄여도 가운데로 화면정렬하려면

본문

그누보드 사이트처럼 브라우져창을 크게화든 작게하든 메인페이지
화면이 가운데로 정렬되게 하려면 어떻게 해야 하나요?

영카트 head.php부분을 적용하엿는데
창을 줄일때 메인페이지 전체화면이 좌측으로 메뉴들이 붙어서 나오거든요 (좌우여백이 없이)
창을 줄여 보더라도 가운데 정렬로 되게 하는 정확한 방법좀 갈켜 주세요
부탁드려요

width='1000'->width='<?=$table_width?> 이렇게 수정한방법은 안됩니다!
힘드네요..
-----------------------------------


아래는
head.php의 상단 내용입니다
------------------------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

include_once("$g4[path]/head.sub.php");
include_once("$g4[path]/lib/outlogin.lib.php");
include_once("$g4[path]/lib/poll.lib.php");
include_once("$g4[path]/lib/visit.lib.php");
include_once("$g4[path]/lib/connect.lib.php");
include_once("$g4[path]/lib/popular.lib.php");

//print_r2(get_defined_constants());

// 사용자 화면 상단과 좌측을 담당하는 페이지입니다.
// 상단, 좌측 화면을 꾸미려면 이 파일을 수정합니다.

$table_width = 800;

//print_r2($g4);
//$dir = dirname($HTTP_SERVER_VARS["PHP_SELF"]);
?>

<style>
.amount { color:#2266BB; font-weight:bold; font-family:Verdana; }
.c1 { background-color:#94D7E7; }
.c2 { background-color:#E7F3F7; }
</style>



<!-- 전체 -->
<table align=center width='1000' cellpadding=0 cellspacing=0 border=0>
<tr>
    <td width='900'>


<!-- 상단 -->
<table align=center width='<?=$table_width?>' cellpadding=0 cellspacing=0 border=0>
<tr><td colspan=2 height=4 bgcolor=#DCDCDB></td></tr>
<tr>
    <td rowspan=2 align=left width=200 height=60><a href='<?=$g4[path]?>/'><img src='<?=$g4[path]?>/img/go.gif' border=0></a></td>
    <td align=right class=small>
       
        <? if ($is_member) { ?>
        <a href='<?=$g4[bbs_path]?>/logout.php'>로그아웃</a> |
        <a href='<?=$g4[bbs_path]?>/member_confirm.php?url=register_form.php'>정보수정</a> |
        <? } else { ?>
        <a href='<?=$g4[bbs_path]?>/login.php?url=<?=$urlencode?>'>로그인</a> |
        <a href='<?=$g4[bbs_path]?>/register.php'>회원가입</a> |
        <? } ?>

        <a hre='<?=$g4[shop_path]?>/cart.php'>회원저장<span class=small>(<?=get_cart_count(get_session('ss_on_uid'));?>)</span></a> |
        <a hre='<?=$g4[shop_path]?>/orderinquiry.php'>회원검색</a> |
        <a hre='<?=$g4[shop_path]?>/onlinecalc.php'>의뢰인대행</a> |
        <a hre='<?=$g4[shop_path]?>/faq.php'>FAQ</a> |
        <a href='<?=$g4[shop_path]?>/mypage.php'>마이페이지</a>&nbsp;
    </td>
</tr>
<tr>

<tr>
    <td colspan=2 align=right height=30>
        <!-- 검색 시작 -->
        <form name='frmsearch1' style='margin:0px;' onsubmit='return search_submit(this);'>
        <input type='hidden' name='sfl' value='wr_subject||wr_content'>
        <input type='hidden' name='sop' value='and'>
        <input type='hidden' name='stx' value=''>
        <select name='search_flag' id='search_flag' class='small'>
        <option value='행인'>행인
        <option value='인'>인
        </select>
        <input type=text name=search_str class='ed' value='<?=stripslashes(get_text($search_str))?>'>
        <input type=image src='<?=$g4[path]?>/img/btn_search.gif' border=0 align=absmiddle>&nbsp;
        </form>
        <script>
        function search_submit(f) {
            if (f.search_flag.value == '행인') {
                f.action = '<?=$g4[shop_path]?>/search.php';
            } else {
                f.stx.value = f.search_str.value;
                f.action = '<?=$g4[bbs_path]?>/search.php';
            }
        }

        <?
        if ($search_flag) {
            echo "document.getElementById('search_flag').value = '$search_flag';";
        }
        ?>
        </script>
        <!-- 검색 끝 -->
    </td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#DCDCDC></td></tr>
<tr><td colspan=2 height=5></td></tr>
</table>
<!-- 상단끝 -->


<!-- 중간 -->
<table align=center width='<?=$table_width?>' cellpadding=0 cellspacing=0 border=0>
<tr>
    <td align=center valign=top width=185>

        <?=outlogin("shop_outlogin"); // 외부 로그인 ?>
        <br>
  • 복사

댓글 전체

제가 이해를 잘 못 한 모양이네요.
다른 방법도 있지만 가장 수정을 적게 하면서 적용할 수 있는 방법입니다.

1. head.php 화일을 여시고 다음부분을 넣어주세요

$table_width = 1004;
?>
<div  align="center"> <<== 이 부분을 넣어 주세요!!!
<!-- 상단 배경 시작 -->

2. tail.php 화일을 여시고 다음 부분을 수정해 주세요!

<!-- 카피라이트 시작 -->
<table width="<?=$table_width?>" border="0" cellspacing="10" cellpadding="10">
<tr>
    <td valign="top" background="<?=$g4['path']?>/img/copyright.gif"><a href="#g4_head"><img src="<?=$g4['path']?>/img/icon.gif" width="15" height="12" border="0"></a><font color="#848484">Copyright ⓒ your-domain. All rights reserved.</font></td>
</tr>
</table>
</div> <<== 추가된 부분입니다. 이 부분을 넣어 주세요
<!-- 카피라이트 끝 -->

두군데만 수정하시면 잘 되실 겁니다.

즉 위의 올리신 head.php 소스로 보면 다음 부분에 넣어 주시면 됩니다.

<div align=center> <<== 바로 여기에!!!!
<!-- 전체 -->
<table align=center width='1000' cellpadding=0 cellspacing=0 border=0>
<tr>
    <td width='900'>

tail.php 는 수정해 주세요!
윗분께서 알려드린부분이 div 태그 이용해서 간단하게 구현하신것이구요

님께서 테이블을 이용해서 하신다면

<!-- 전체 -->
<table align=center width='1000' cellpadding=0 cellspacing=0 border=0>
<tr>
    <td width='900'>

    이부분을....

<!-- 전체 -->
<table  width='100%' cellpadding=0 cellspacing=0 border=0>
<tr>
    <td align="center">

이렇게 하시면 될듯..

아마 전체부분을 추가시키신것 같은데..tail.php 부분에도 </td></tr></table> 을 추가하셨죠?
© SIRSOFT
현재 페이지 제일 처음으로