table cell 마진 지정이 안됩니다.

아래 코드로 테이블 셀 마진을 지정하려고 하는데 마진이 지정되지는 않고, 테이블 셀 속성을 보면 첨부해 드린 이미지 처럼 입력만 되어있습니다.
function cellMargin(axHwpCtrl, top, bottom, left, right) {
try {
let tableSet = axHwpCtrl.CreateSet(‘Table’);
// 2) “Cell” 항목셋 생성
let cellSet = tableSet.CreateItemSet(‘Cell’, ‘Cell’);
//dact.GetDefault(cellSet);
// 3) mm 단위 → HWP 단위 변환
const nt = mmToIntHWPUNIT(top);
const nb = mmToIntHWPUNIT(bottom);
const nl = mmToIntHWPUNIT(left);
const nr = mmToIntHWPUNIT(right);

// 4) 여백 항목에 값 설정
cellSet.SetItem('MarginTop', nt);
cellSet.SetItem('MarginBottom', nb);
cellSet.SetItem('MarginLeft', nl);
cellSet.SetItem('MarginRight', nr);

// 5) (기존 예시처럼) 높이 예시: 6.9mm → int HWP 단위
var height = mmToIntHWPUNIT(6.9);
cellSet.SetItem('Height', height);

// 6) 컨트롤에 적용
axHwpCtrl.CellShape = tableSet;

} catch (error) {
console.log(‘cellMargin error=’, error);
}
}

1개의 좋아요

표 고치기에 해당하니 TablePropertyDialog 액션을 사용해보세요.
VB6에서 C# 배우는 중이라 좀 부족합니다만…

let tableSet = axHwpCtrl.CreateAction(‘TablePropertyDialog’);
let cellSet = tableSet .CreateSet();
cellSet.SetItem(‘MarginTop’, nt);
.
.
tableSet .Execute cellSet;

요정도 될 듯 싶네요.

1개의 좋아요

다른 방식으로 해결했지만, 관심 가져 주셔서 고맙습니다.

1개의 좋아요