DynaPDF.Table.SetColor
----------------------

Sets or changes the specified color as well as the corresponding device color space.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [3.5](newinversion35.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.Table.SetColor"; Table; Row; Col; Type; CS; Color ) 

**MBS**( **"DynaPDF.Table.SetColor";** /\* Sets or changes the specified color as well as the corresponding device color space. \*/  
**$Table**; /\* The identifier for the table. \*/   
**$Row**; /\* The row number. Range from 0 to [DynaPDF.Table.GetNumRows](DynaPDFTableGetNumRows.md)-1. Pass -1 for all rows.e.g. 0 \*/   
**$Col**; /\* The column number. Range from 0 to [DynaPDF.Table.GetNumCols](DynaPDFTableGetNumCols.md)-1. Pass -1 for all columns.e.g. 0 \*/   
**$Type**; /\* Which table color. Can be BackColor, BorderColor, GridHorzColor, GridVertColor, ImageColor or TextColor.e.g. "TextColor" \*/   
**$CS**; /\* The colorspace to use. Can be DeviceRGB, DeviceCMYK, DeviceGray.e.g. "DeviceRGB" \*/   
**$Color**) /\* The color value.e.g. 255 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Table | The identifier for the table. | $Table |
| Row | The row number. Range from 0 to [DynaPDF.Table.GetNumRows](DynaPDFTableGetNumRows.md)-1. Pass -1 for all rows. | 0 |
| Col | The column number. Range from 0 to [DynaPDF.Table.GetNumCols](DynaPDFTableGetNumCols.md)-1. Pass -1 for all columns. | 0 |
| Type | Which table color. Can be BackColor, BorderColor, GridHorzColor, GridVertColor, ImageColor or TextColor. | "TextColor" |
| CS | The colorspace to use. Can be DeviceRGB, DeviceCMYK, DeviceGray. | "DeviceRGB" |
| Color | The color value. | 255 |

### Result

Returns OK or error.

### Description

Sets or changes the specified color as well as the corresponding device color space.   
Colors of an extended color space can be set with [DynaPDF.Table.SetColorFloat](DynaPDFTableSetColorFloat.md).  
The text color is inherited from the table, column, and row, in this order. The border color is inherited from columns and rows but not from the table since the table has its own border.  
### Examples

Set green text color:

 MBS ( "DynaPDF.Table.SetColor"; $table ; $Row ; $Col ; "TextColor"; "DeviceRGB"; 255\*256 )  
### See also

- [DynaPDF.Table.AddColumn](DynaPDFTableAddColumn.md)
- [DynaPDF.Table.DeleteCol](DynaPDFTableDeleteCol.md)
- [DynaPDF.Table.GetNumCols](DynaPDFTableGetNumCols.md)
- [DynaPDF.Table.GetNumRows](DynaPDFTableGetNumRows.md)
- [DynaPDF.Table.SetCellText](DynaPDFTableSetCellText.md)
- [DynaPDF.Table.SetColorFloat](DynaPDFTableSetColorFloat.md)
- [DynaPDF.Table.SetColWidth](DynaPDFTableSetColWidth.md)
- [DynaPDF.Table.SetFlags](DynaPDFTableSetFlags.md)
- [DynaPDF.Table.SetFont](DynaPDFTableSetFont.md)
- [DynaPDF.Table.SetPDF](DynaPDFTableSetPDF.md)

### Release notes

- **Version 16.2**
    - Added [DynaPDF.Table.SetColOrRowSpan](https://www.mbsplugins.eu/DynaPDFTableSetColOrRowSpan.shtml) function.
- **Version 12.0**
    - Documented missing color space handle parameter for [DynaPDF.Table.SetColorFloat](https://www.mbsplugins.eu/DynaPDFTableSetColorFloat.shtml) function.

This function checks for a license.

Created 18th August 2014 , last changed 18th August 2014

  
[DynaPDF.Table.SetColWidth](DynaPDFTableSetColWidth.md) - [DynaPDF.Table.SetColorFloat](DynaPDFTableSetColorFloat.md)

[HTML Version](DynaPDFTableSetColor.shtml)