Word 테이블의 테이블 생성 자동 테이블 추가
다음은 일부 코드로 표에 대해 자동으로 표 내용을 추가합니다
import java.util.ArrayList;
import com.heavenlake.wordapi.Document;
public class test
{
public test()
{
Document doc = null;
try {
doc = new Document();
doc.newDoc("e:/test4.doc");
doc.insertln(" ");
doc.insertln(" ");
//doc.saveAs("e:/test2.doc");
ArrayList tableData = new ArrayList(3);
String[] title = {
" ", " ", " "," "};
tableData.add(title);
String[] field1 = {
"1", "751002", " ","www.heavenlake.com"};
tableData.add(field1);
String[] field2 = {
"2", "751004", " ","pdm.heavenlake.com"};
tableData.add(field2);
doc.insert(tableData," ");
doc.insertln();
ArrayList tableData1 = new ArrayList(3);
String[] field3 = {
"1", "751002", " ","www.heavenlake.com"};
tableData1.add(field3);
String[] field4 = {
"2", "751004", " ","pdm.heavenlake.com"};
tableData1.add(field4);
doc.replaceTable(1, 4, tableData1);
} catch (Exception e)
{
e.printStackTrace();
} finally
{
try
{
if (doc != null)
doc.close(true);
} catch (Exception e)
{
e.printStackTrace();
}
}
}
public static void main(String[] args)
{
test test1 = new test();
}
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
IE를 지원하지 않아도 된다면 가장 쓸모 있는Column flex items set to align-items: center overflow their container Column flex items ignore margin: auto on the cross...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.