本文整理汇总了C#中CT_Tbl.AddNewTblPr方法的典型用法代码示例。如果您正苦于以下问题:C# CT_Tbl.AddNewTblPr方法的具体用法?C# CT_Tbl.AddNewTblPr怎么用?C# CT_Tbl.AddNewTblPr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CT_Tbl
的用法示例。
在下文中一共展示了CT_Tbl.AddNewTblPr方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestSetGetWidth
public void TestSetGetWidth()
{
XWPFDocument doc = new XWPFDocument();
CT_Tbl table = new CT_Tbl();
table.AddNewTblPr().AddNewTblW().w = "1000";
XWPFTable xtab = new XWPFTable(table, doc);
Assert.AreEqual(1000, xtab.Width);
xtab.Width = 100;
Assert.AreEqual(100, int.Parse(table.tblPr.tblW.w));
}
示例2: CreateEmptyTable
private void CreateEmptyTable(CT_Tbl table)
{
// MINIMUM ELEMENTS FOR A TABLE
table.AddNewTr().AddNewTc().AddNewP();
CT_TblPr tblpro = table.AddNewTblPr();
if (!tblpro.IsSetTblW())
tblpro.AddNewTblW().w = "0";
tblpro.tblW.type=(ST_TblWidth.auto);
// layout
// tblpro.AddNewTblLayout().Type=(STTblLayoutType.AUTOFIT);
// borders
CT_TblBorders borders = tblpro.AddNewTblBorders();
borders.AddNewBottom().val=(ST_Border.single);
borders.AddNewInsideH().val = (ST_Border.single);
borders.AddNewInsideV().val = (ST_Border.single);
borders.AddNewLeft().val = (ST_Border.single);
borders.AddNewRight().val = (ST_Border.single);
borders.AddNewTop().val = (ST_Border.single);
/*
* CTTblGrid tblgrid=table.AddNewTblGrid();
* tblgrid.AddNewGridCol().W=(new Bigint("2000"));
*/
GetRows();
}
示例3: CreateEmptyTable
private void CreateEmptyTable(CT_Tbl table)
{
// MINIMUM ELEMENTS FOR A TABLE
table.AddNewTr().AddNewTc().AddNewP();
CT_TblPr tblpro = table.AddNewTblPr();
if (!tblpro.IsSetTblW())
tblpro.AddNewTblW().w = "0";
tblpro.tblW.type=(ST_TblWidth.auto);
// layout
tblpro.AddNewTblLayout().type = ST_TblLayoutType.autofit;
// borders
CT_TblBorders borders = tblpro.AddNewTblBorders();
borders.AddNewBottom().val=ST_Border.single;
borders.AddNewInsideH().val = ST_Border.single;
borders.AddNewInsideV().val = ST_Border.single;
borders.AddNewLeft().val = ST_Border.single;
borders.AddNewRight().val = ST_Border.single;
borders.AddNewTop().val = ST_Border.single;
CT_TblGrid tblgrid=table.AddNewTblGrid();
tblgrid.AddNewGridCol().w= (ulong)2000;
}