Class TableCell

Class TableCell

이름 공간 : Aspose.Note 모임: Aspose.Note.dll (25.4.0)

테이블 세포를 나타냅니다.

public sealed class TableCell : IndentatedNode<iOutlineChildNode>, INode, ICompositeNode<iOutlineChildNode>, ICompositeNode, IEnumerable<iOutlineChildNode>, IEnumerable, IIndentatedNode
   {
      public override string Text { get; set; }
      public int RowIndex { get; set; }
      public int ColumnIndex { get; set; }
   }

Inheritance

object Node CompositeNodeBase CompositeNode IndentatedNode TableCell

Implements

INode , ICompositeNode , ICompositeNode , IEnumerable , IEnumerable , IIndentatedNode

상속 회원들

IndentatedNode.IndentPosition , CompositeNode.GetEnumerator() , CompositeNode.InsertChild(int, T1) , CompositeNode.InsertChildrenRange(int, IEnumerable) , CompositeNode.InsertChildrenRange(int, params IOutlineChildNode[]) , CompositeNode.AppendChildFirst(T1) , CompositeNode.AppendChildLast(T1) , CompositeNode.RemoveChild(T1) , CompositeNode.Accept(DocumentVisitor) , CompositeNode.GetChildNodes(NodeType) , CompositeNode.GetChildNodes() , CompositeNode.IsComposite , CompositeNode.FirstChild , CompositeNode.LastChild , CompositeNodeBase.GetChildNodes(NodeType) , CompositeNodeBase.GetChildNodes() , Node.Accept(DocumentVisitor) , Node.Document , Node.IsComposite , Node.NodeType , Node.ParentNode , Node.PreviousSibling , Node.NextSibling , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

테이블의 세포에서 텍스트를 얻는 방법을 보여줍니다.

string dataDir = RunExamples.GetDataDir_Tables();
   Document document = new Document(dataDir + "Sample1.one");
   IList<Table> nodes = document.GetChildNodes<Table>();
   foreach (Table table in nodes)
   {
      foreach (TableRow row in table)
      {
         IList<TableCell> cells = row.GetChildNodes<TableCell>();
         foreach (TableCell cell in cells)
         {
            string text = string.Join(Environment.NewLine, cell.GetChildNodes<RichText>().Select(e => e.Text)) + Environment.NewLine;
            Console.WriteLine(text);
         }
      }
   }

셀에 대한 배경 색상을 설정하는 방법을 보여줍니다.

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);
   TableColumn column = new TableColumn() { Width = 200 };
   Table table = new Table(doc)
   {
       IsBordersVisible = true,
       Columns = { column }
   };
   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"));

태그와 함께 새로운 테이블을 추가하는 방법을 보여줍니다.

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 = dataDir + "AddTableNodeWithTag_out.one";
   doc.Save(dataDir);

잠겨있는 열을 가진 테이블을 만드는 방법을 보여줍니다.

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);

새로운 테이블을 만드는 방법을 보여줍니다.

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

테이블 셀()

public TableCell()
   {
   }

Properties

BackgroundColor

배경 색을 얻거나 설정합니다.

public Color BackgroundColor
   {
      get;
      set;
   }

부동산 가치

Color

Examples

셀에 대한 배경 색상을 설정하는 방법을 보여줍니다.

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"));

LastModifiedTime

마지막으로 변경된 시간을 얻거나 설정합니다.

public DateTime LastModifiedTime
   {
      get;
      set;
   }

부동산 가치

DateTime

MaxWidth

맥스 폭을 얻으십시오.

public float MaxWidth
   {
      get;
   }

부동산 가치

float

Methods

서류 방문자 (DocumentVisitor)

노드의 방문자를 받아들인다.

public override void Accept(Aspose.Words.DocumentVisitor visitor)
   {
   }

Parameters

visitor DocumentVisitor

클래스의 개체는 Aspose.Note.DocumentVisitor에서 유래합니다.

 한국어