fix: 전화 주문접수표 판매수량 입력 시 열 위치 흔들림 고정(#12)

table-layout: fixed + colgroup으로 전 컬럼 폭을 고정해, 판매수량
자릿수가 바뀌어도 다른 컬럼 위치가 좌우로 움직이지 않게 한다.

검증 중 발견해 함께 수정:
- "봉투종류" 컬럼을 width:auto로 두면 화면이 좁거나 텍스트 확대 시
  0으로 찌부러지는 문제가 있어, 최장 품목명 실측 기준 고정폭(11rem)으로 변경.
- "구분" 컬럼(4.5rem)이 "음식물 스티커"·"대형폐기물 스티커" 라벨보다 좁아
  옆 컬럼과 텍스트가 겹치던 문제를 8rem으로 넓혀 해결.
- 공간이 부족하면 기존 overflow-auto로 표 전체가 가로 스크롤된다.
This commit is contained in:
taekyoungc
2026-07-02 13:24:10 +09:00
parent 5a8e61227e
commit 9bf1b34faf

View File

@@ -141,7 +141,8 @@ unset($g);
<label class="block text-sm font-bold text-gray-700 mb-2">전화 주문접수표 (일괄)</label>
<style>
/* 그룹 헤더(rowspan/colspan) 경계선이 단가까지 이어지는 현상 방지 — 헤더 맨 아래 한 줄만 */
table.phone-batch-table { border-collapse: separate; border-spacing: 0; }
/* table-layout: fixed — 판매수량 입력 시 숫자 자릿수 변화로 열 너비가 흔들리는 현상 방지 */
table.phone-batch-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; }
table.phone-batch-table thead th { border-bottom: 0; }
table.phone-batch-table thead tr:last-child th { border-bottom: 1px solid #e5e7eb; } /* 수량/금액 등 하위 헤더 */
table.phone-batch-table thead tr:first-child th[rowspan] { border-bottom: 1px solid #e5e7eb; } /* 구분·봉투종류·단가 */
@@ -152,6 +153,21 @@ unset($g);
</style>
<div class="border border-gray-300 rounded-lg p-2 overflow-auto">
<table class="w-full data-table text-sm phone-batch-table">
<colgroup>
<col style="width:8rem"/> <!-- 구분: 최장 라벨("대형폐기물 스티커") 기준 고정폭 -->
<col style="width:11rem"/> <!-- 봉투종류: 최장 품목명(예: "폐기물 스티커 10,000원") 기준 고정폭.
width:auto는 화면이 좁거나 텍스트 확대 시 0으로 찌부러질 수 있어 사용 안 함. -->
<col style="width:4rem"/> <!-- Pack 수량 -->
<col style="width:5.5rem"/> <!-- Pack 금액 -->
<col style="width:4rem"/> <!-- Box 수량 -->
<col style="width:5.5rem"/> <!-- Box 금액 -->
<col style="width:5rem"/> <!-- 단가 -->
<col style="width:6rem"/> <!-- 판매수량 -->
<col style="width:6rem"/> <!-- 금액 -->
<col style="width:3rem"/> <!-- B -->
<col style="width:3rem"/> <!-- P -->
<col style="width:3rem"/> <!-- E -->
</colgroup>
<thead>
<tr>
<th class="text-center" rowspan="2">구분</th>