Class TableRow
İsim alanı : Aspose.Note Toplama: Aspose.Note.dll (25.4.0)
Bir tablo sırası oluşturur.
public sealed class TableRow : CompositeNode<TableCell>, INode, ICompositeNode<TableCell>, ICompositeNode, IEnumerable<TableCell>, IEnumerable
{
public TableRow()
{
}
protected override void OnAppendChild(TableCell child)
{
}
protected internal override void OnRemoveChild(TableCell child)
{
}
public IEnumerator<TableCell> GetEnumerator()
{
}
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
}
Inheritance
object
←
Node
←
CompositeNodeBase
←
CompositeNode
Implements
INode
,
ICompositeNode
mirasçı üyeleri
CompositeNode
Examples
Her tablo sırasından metin nasıl alınır gösterir.
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)
{
string text = string.Join(Environment.NewLine, row.GetChildNodes<RichText>().Select(e => e.Text)) + Environment.NewLine;
Console.WriteLine(text);
}
}
Bir tablo hücrelerinden metin nasıl alınır gösterir.
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);
}
}
}
Bir hücre için bir arka plan rengi nasıl ayarlanır gösterir.
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"));
Etiketler ile yeni bir tablo nasıl eklendiğini gösterir.
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);
Kapalı bir sütun ile bir tablo nasıl oluşturulur gösterir.
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);
Yeni bir tablo nasıl oluşturulur.
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);
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);
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
Tablo Yorumları ()
public TableRow()
{
}
Properties
LastModifiedTime
Son değiştirilmiş zaman alır veya ayarlar.
public DateTime LastModifiedTime
{
get;
set;
}
Mülkiyet Değer
Methods
Başvuru Sayısı (DokumentVisitor)
Ziyaretçi düğümünü kabul eder.
public override void Accept(Aspose.Words.DocumentVisitor visitor)
{
}
Parameters
visitor
DocumentVisitor
Bir sınıfın nesnesi Aspose.Note.DocumentVisitor’dan kaynaklanmaktadır.