## TableCell.BackgroundColor property

获取或设置背景颜色。

```csharp
public Color BackgroundColor { get; set; }
```

### 例子

显示如何为单元格设置背景颜色。

```csharp
// 创建文档类的对象
Document doc = new Document();

// 初始化TableCell类对象并设置文本内容
TableCell cell11 = new TableCell(doc);
cell11.AppendChildLast(InsertTable.GetOutlineElementWithText(doc, "Small text"));
cell11.BackgroundColor = Color.Coral;

// 初始化 TableRow 类对象
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"));
```

### 也可以看看

* class [TableCell](../)
* 命名空间 [Aspose.Note](../../tablecell/)
* 部件 [Aspose.Note](../../../)


