Class ZebraColor
Represents a pair of colors used for applying zebra background to table rows.
Inheritance
Namespace: IronWord.Models
Assembly: IronWord.dll
Syntax
public class ZebraColor : Object
ZebraColor is the alternating-row color pair you set on a table so its rows band between two shades, the banded look that makes a long table easier to read. It holds the two colors that take turns down the rows, giving a table its striped appearance without coloring each row by hand.
A ZebraColor reaches a table through Table, whose Zebra property is a ZebraColor. Assign a configured pair there and the table renders its rows in alternating colors when the document is saved. Construct one by passing the two colors to the constructor, either as Color values or as string color specifications, since there is no parameterless constructor: a ZebraColor always carries both colors from the start. The two shades are held by Color1 and Color2, the colors applied to alternating rows, and you can read or replace either after construction to retune the banding. Pick two shades with enough contrast to separate the rows but close enough to stay subtle, then assign the pair to a table's Zebra property so the striping applies across every row.
using IronWord.Models;
var zebra = new ZebraColor(Color.White, Color.LightGray);The add table how-to covers building tables, and the table example shows a worked table in code.
Constructors
ZebraColor(Color, Color)
Initializes a new instance of the ZebraColor class with the specified colors.
Declaration
public ZebraColor(Color color1, Color color2)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | color1 | The first color of the zebra pair. |
| Color | color2 | The second color of the zebra pair. |
ZebraColor(String, String)
Initializes a new instance of the ZebraColor class with the specified colors.
Declaration
public ZebraColor(string color1, string color2)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | color1 | The first color of the zebra pair. |
| System.String | color2 | The second color of the zebra pair. |
Properties
Color1
Gets or set the first color of the zebra pair.
Declaration
public Color Color1 { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
Color2
Gets or set the second color of the zebra pair.
Declaration
public Color Color2 { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |