Class TableColumn

Class TableColumn

Tên không gian: Aspose.Note Tổng hợp: Aspose.Note.dll (25.4.0)

đại diện cho một cột bảng.

public sealed class TableColumn
   {
       private string name;
       private int index;
       private Table parentTable;
       public string Name
       {
           get { return this.name; }
       }
       public int Index
       {
           get { return this.index; }
       }
       public Table ParentTable
       {
           get { return this.parentTable; }
       }
       public TableColumn(string name, int index)
       {
           this.name = name;
           this.index = index;
       }
       public void SetParentTable(Table parentTable)
       {
           this.parentTable = parentTable;
       }
   }

Inheritance

object TableColumn

Thành viên thừa kế

object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

Hiển thị cách thiết lập màu nền cho một tế bào.

Document doc = new Document();
   TableCell cell11 = new TableCell(doc);
   cell11.AppendChildLast(InsertTable.GetOutlineElementWithText(doc, "Small text"));
   cell11.BackgroundColor = Color.Coral;
   TableRow row = new TableRow(doc);
   row.AppendChildLast(cell11);
   Table table = new Table(doc)
   {
       IsBordersVisible = true,
       Columns = { new TableColumn() { Width = 200 } }
   };
   table.AppendChildLast(row);
   OutlineElement oe = new OutlineElement(doc);
   oe.AppendChildLast(table);
   Outline o = new Outline(doc);
   o.AppendChildLast(oe);
   Page page = new Page(doc);
   page.AppendChildLast(o);
   doc.AppendChildLast(page);
   doc.Save(Path.Combine(RunExamples.GetDataDir_Tables(), "SettingCellBackGroundColor.pdf"));

Hiển thị làm thế nào để thêm bảng mới với thẻ.

string dataDir = RunExamples.GetDataDir_Tags();
   Document doc = new Document();
   Aspose.Note.Page page = new Aspose.Note.Page(doc);
   TableRow row = new TableRow(doc);
   TableCell cell = new TableCell(doc);
   cell.AppendChildLast(InsertTable.GetOutlineElementWithText(doc, "Single cell."));
   row.AppendChildLast(cell);
   Table table = new Table(doc)
   {
      IsBordersVisible = true,
      Columns = { new TableColumn { Width = 70 } }
   };
   table.AppendChildLast(row);
   table.Tags.Add(NoteTag.CreateQuestionMark());
   Outline outline = new Outline(doc);
   OutlineElement outlineElem = new OutlineElement(doc);
   outlineElem.AppendChildLast(table);
   outline.AppendChildLast(outlineElem);
   page.AppendChildLast(outline);
   doc.AppendChildLast(page);
   dataDir = dataDir + "AddTableNodeWithTag_out.one";
   doc.Save(dataDir);

Hiển thị cách tạo một bảng với một cột bị khóa.

string dataDir = RunExamples.GetDataDir_Tables();
   Document doc = new Document();
   Aspose.Note.Page page = new Aspose.Note.Page(doc);
   TableRow row1 = new TableRow(doc);
   TableCell cell11 = new TableCell(doc);
   cell11.AppendChildLast(InsertTable.GetOutlineElementWithText(doc, "Small text"));
   row1.AppendChildLast(cell11);
   TableRow row2 = new TableRow(doc);
   TableCell cell21 = new TableCell(doc);
   cell21.AppendChildLast(InsertTable.GetOutlineElementWithText(doc, "Long   text    with    several   words and    spaces."));
   row2.AppendChildLast(cell21);
   Table table = new Table(doc)
   {
      IsBordersVisible = true,
      Columns = { new TableColumn { Width = 70, LockedWidth = true } }
   };
   table.AppendChildLast(row1);
   table.AppendChildLast(row2);
   Outline outline = new Outline(doc);
   OutlineElement outlineElem = new OutlineElement(doc);
   outlineElem.AppendChildLast(table);
   outline.AppendChildLast(outlineElem);
   page.AppendChildLast(outline);
   doc.AppendChildLast(page);
   dataDir = dataDir + "CreateTableWithLockedColumns_out.one";
   doc.Save(dataDir);

Hiển thị cách tạo một bảng mới.

string dataDir = RunExamples.GetDataDir_Tables();
   Document doc = new Document();
   Aspose.Note.Page page = new Aspose.Note.Page(doc);
   TableRow row1 = new TableRow(doc);
   TableCell cell11 = new TableCell(doc);
   TableCell cell12 = new TableCell(doc);
   TableCell cell13 = new TableCell(doc);
   cell11.AppendChildLast(GetOutlineElementWithText(doc, "cell_1.1"));
   cell12.AppendChildLast(GetOutlineElementWithText(doc, "cell_1.2"));
   cell13.AppendChildLast(GetOutlineElementWithText(doc, "cell_1.3"));
   row1.AppendChildLast(cell11);
   row1.AppendChildLast(cell12);
   row1.AppendChildLast(cell13);
   TableRow row2 = new TableRow(doc);
   TableCell cell21 = new TableCell(doc);
   TableCell cell22 = new TableCell(doc);
   TableCell cell23 = new TableCell(doc);
   cell21.AppendChildLast(GetOutlineElementWithText(doc, "cell_2.1"));
   cell22.AppendChildLast(GetOutlineElementWithText(doc, "cell_2.2"));
   cell23.AppendChildLast(GetOutlineElementWithText(doc, "cell_2.3"));
   row2.AppendChildLast(cell21);
   row2.AppendChildLast(cell22);
   row2.AppendChildLast(cell23);
   Table table = new Table(doc)
   {
       IsBordersVisible = true,
       Columns = { new TableColumn { Width = 200 }, new TableColumn { Width = 200 }, new TableColumn { Width = 200 } }
   };
   table.AppendChildLast(row1);
   table.AppendChildLast(row2);
   Outline outline = new Outline(doc);
   OutlineElement outlineElem = new OutlineElement(doc);
   outlineElem.AppendChildLast(table);
   outline.AppendChildLast(outlineElem);
   page.AppendChildLast(outline);
   doc.AppendChildLast(page);
   dataDir = dataDir + "InsertTable_out.one";
   doc.Save(dataDir);

Constructors

Màn hình()

public TableColumn()
   {
   }

Properties

LockedWidth

Nhận hoặc đặt một giá trị cho thấy liệu một cột bảng đã bị khóa chiều rộng và không tự động chuyển đổi để phù hợp với nội dung bảng.Theo mặc định, chiều rộng cột không bị khóa.

public bool LockedWidth
   {
      get;
      set;
   }

Giá trị bất động sản

bool

Examples

Hiển thị cách tạo một bảng với một cột bị khóa.

string dataDir = RunExamples.GetDataDir_Tables();
   Document doc = new Document();
   Aspose.Note.Page page = new Aspose.Note.Page(doc);
   TableRow row1 = new TableRow(doc);
   TableCell cell11 = new TableCell(doc);
   cell11.AppendChildLast(InsertTable.GetOutlineElementWithText(doc, "Small text"));
   row1.AppendChildLast(cell11);
   TableRow row2 = new TableRow(doc);
   TableCell cell21 = new TableCell(doc);
   cell21.AppendChildLast(InsertTable.GetOutlineElementWithText(doc, "Long text with several words and spaces."));
   row2.AppendChildLast(cell21);
   Table table = new Table(doc)
   {
       IsBordersVisible = true
   };
   table.Columns.Add(new TableColumn() { Width = 70, LockedWidth = true });
   table.AppendChildLast(row1);
   table.AppendChildLast(row2);
   Outline outline = new Outline(doc);
   OutlineElement outlineElem = new OutlineElement(doc);
   outlineElem.AppendChildLast(table);
   outline.AppendChildLast(outlineElem);
   page.AppendChildLast(outline);
   doc.AppendChildLast(page);
   dataDir = dataDir + "CreateTableWithLockedColumns_out.one";
   doc.Save(dataDir);

Width

Nhận hoặc đặt chiều rộng.

public float Width
   {
      get;
      set;
   }

Giá trị bất động sản

float

Examples

Hiển thị cách thiết lập màu nền cho một tế bào.

Document doc = new Document();
   TableCell cell11 = new TableCell(doc);
   cell11.AppendChildLast(InsertTable.GetOutlineElementWithText(doc, "Small text"));
   cell11.BackgroundColor = Color.Coral;
   TableRow row = new TableRow(doc);
   row.AppendChildLast(cell11);
   Table table = new Table(doc)
   {
       IsBordersVisible = true,
       Columns = { new TableColumn() { Width = 200 } }
   };
   table.AppendChildLast(row);
   OutlineElement oe = new OutlineElement(doc);
   oe.AppendChildLast(table);
   Outline o = new Outline(doc);
   o.AppendChildLast(oe);
   Page page = new Page(doc);
   page.AppendChildLast(o);
   doc.AppendChildLast(page);
   doc.Save(Path.Combine(RunExamples.GetDataDir_Tables(), "SettingCellBackGroundColor.pdf"));

Hiển thị làm thế nào để thêm bảng mới với thẻ.

string dataDir = RunExamples.GetDataDir_Tags();
   Document doc = new Document();
   Aspose.Note.Page page = new Aspose.Note.Page(doc);
   TableRow row = new TableRow(doc);
   TableCell cell = new TableCell(doc);
   cell.AppendChildLast(InsertTable.GetOutlineElementWithText(doc, "Single cell."));
   row.AppendChildLast(cell);
   Table table = new Table(doc)
   {
      IsBordersVisible = true,
      Columns = { new TableColumn { Width = 70 } }
   };
   table.AppendChildLast(row);
   table.Tags.Add(NoteTag.CreateQuestionMark());
   OutlineElement outlineElem = new OutlineElement(doc);
   outlineElem.AppendChildLast(table);
   Outline outline = new Outline(doc);
   outline.AppendChildLast(outlineElem);
   page.AppendChildLast(outline);
   doc.AppendChildLast(page);
   dataDir += "AddTableNodeWithTag_out.one";
   doc.Save(dataDir);

Hiển thị cách tạo một bảng với một cột bị khóa.

string dataDir = RunExamples.GetDataDir_Tables();
   Document doc = new Document();
   Aspose.Note.Page page = new Aspose.Note.Page(doc);
   TableRow row1 = new TableRow(doc);
   TableCell cell11 = new TableCell(doc);
   cell11.AppendChildLast(InsertTable.GetOutlineElementWithText(doc, "Small text"));
   row1.AppendChildLast(cell11);
   TableRow row2 = new TableRow(doc);
   TableCell cell21 = new TableCell(doc);
   cell21.AppendChildLast(InsertTable.GetOutlineElementWithText(doc, "Long   text    with    several   words and    spaces."));
   row2.AppendChildLast(cell21);
   Table table = new Table(doc)
   {
       IsBordersVisible = true,
       Columns = { new TableColumn { Width = 70, LockedWidth = true } }
   };
   table.AppendChildLast(row1);
   table.AppendChildLast(row2);
   Outline outline = new Outline(doc);
   OutlineElement outlineElem = new OutlineElement(doc);
   outlineElem.AppendChildLast(table);
   outline.AppendChildLast(outlineElem);
   page.AppendChildLast(outline);
   doc.AppendChildLast(page);
   dataDir = dataDir + "CreateTableWithLockedColumns_out.one";
   doc.Save(dataDir);

Hiển thị cách tạo một bảng mới.

string dataDir = RunExamples.GetDataDir_Tables();
   Document doc = new Document();
   Aspose.Note.Page page = new Aspose.Note.Page(doc);
   TableRow row1 = new TableRow(doc);
   TableCell cell11 = new TableCell(doc);
   TableCell cell12 = new TableCell(doc);
   TableCell cell13 = new TableCell(doc);
   cell11.AppendChildLast(GetOutlineElementWithText(doc, "cell_1.1"));
   cell12.AppendChildLast(GetOutlineElementWithText(doc, "cell_1.2"));
   cell13.AppendChildLast(GetOutlineElementWithText(doc, "cell_1.3"));
   row1.AppendChildLast(cell11);
   row1.AppendChildLast(cell12);
   row1.AppendChildLast(cell13);
   TableRow row2 = new TableRow(doc);
   TableCell cell21 = new TableCell(doc);
   TableCell cell22 = new TableCell(doc);
   TableCell cell23 = new TableCell(doc);
   cell21.AppendChildLast(GetOutlineElementWithText(doc, "cell_2.1"));
   cell22.AppendChildLast(GetOutlineElementWithText(doc, "cell_2.2"));
   cell23.AppendChildLast(GetOutlineElementWithText(doc, "cell_2.3"));
   row2.AppendChildLast(cell21);
   row2.AppendChildLast(cell22);
   row2.AppendChildLast(cell23);
   Table table = new Table(doc)
   {
       IsBordersVisible = true,
       Columns = { new TableColumn { Width = 200 }, new TableColumn { Width = 200 }, new TableColumn { Width = 200 } }
   };
   table.AppendChildLast(row1);
   table.AppendChildLast(row2);
   Outline outline = new Outline(doc);
   OutlineElement outlineElem = new OutlineElement(doc);
   outlineElem.AppendChildLast(table);
   outline.AppendChildLast(outlineElem);
   page.AppendChildLast(outline);
   doc.AppendChildLast(page);
   dataDir = dataDir + "InsertTable_out.one";
   doc.Save(dataDir);
 Tiếng Việt