Top
You are looking at an outdated 7.3.1 version of this document. Switch to the 8.0.1 version to see the up to date information.

class anychart.core.ui.Table.Cell Improve this Doc

Extends: goog.Disposable

Table cell.

Methods Overview

Miscellaneous
border()Setter for cell border settings.
bottomBorder()Setter for cell bottom border settings.
colSpan()Getter for cell columns span.
content()Getter for cell content.
fill()Fill as a string or an object.
getBounds()Returns cell bounds without padding counted (bounds which are used for borders drawing).
getCol()Returns current cell column number.
getRow()Returns current cell row number.
leftBorder()Setter for cell left border settings.
padding()Getter for current cell padding settings.
rightBorder()Setter for cell right border settings.
rowSpan()Getter for cell rows span.
topBorder()Setter for cell top border settings.

Methods Description

border

Getter for current cell border settings.

Returns:

anychart.graphics.vector.Stroke - Current stroke settings.
Setter for cell border settings.
Learn more about stroke settings: https://docs.anychart.com/7.3.1/General_settings/Elements_Stroke
Note: Pass null to reset to default settings.
Note: lineJoin settings not working here.

Params:

Name Type Default Description
strokeOrFill anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
Fill settings or stroke settings.
thickness number
1
Line thickness.
dashpattern string
Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCap anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.ui.Table.Cell - anychart.core.ui.Table.Cell instance for method chaining.

Try it:

bottomBorder

Getter for current cell bottom border settings.

Returns:

anychart.graphics.vector.Stroke - Current stroke settings.
Setter for cell bottom border settings.
Learn more about stroke settings: https://docs.anychart.com/7.3.1/General_settings/Elements_Stroke
Note: Pass null to reset to default settings.
Note: lineJoin settings not working here.

Params:

Name Type Default Description
strokeOrFill anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
Fill settings or stroke settings.
thickness number
1
Line thickness.
dashpattern string
Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCap anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.ui.Table.Cell - anychart.core.ui.Table.Cell instance for method chaining.

Try it:

colSpan

Getter for cell columns span.

Returns:

number - Current columns span.
Setter for cell columns span.
Note: Cells that are overlapped by other cells are not drawn.

Params:

Name Type Default Description
value number
1
Count of cells to merge right.

Returns:

anychart.core.ui.Table.Cell - anychart.core.ui.Table.Cell instance for method chaining.

Try it:

content

Getter for cell content.

Returns:

anychart.core.ui.Table.CellContent - Current cell content.
Setter for cell content.

Params:

Name Type Description
value anychart.core.ui.Table.CellContent | string | number Value to set.
Note: Numbers and strings are automaticaly set as instance of anychart.core.ui.LabelsFactory.Label class.

Returns:

anychart.core.ui.Table.Cell - anychart.core.ui.Table.Cell class for method chaining.

Try it:

fill

Getter for current series fill color.

Returns:

anychart.graphics.vector.Fill - Current fill color.
Sets fill settings using an object or a string.
Learn more about coloring at: https://docs.anychart.com/7.3.1/General_settings/Elements_Fill

Params:

Name Type Default Description
value anychart.graphics.vector.Fill
null
Color as an object or a string.

Returns:

anychart.core.ui.Table.Cell - anychart.core.ui.Table.Cell instance for method chaining.
Fill color with opacity.
Note: If color is set as a string (e.g. 'red .5') it has a priority over opt_opacity, which means: color set like this rect.fill('red 0.3', 0.7) will have 0.3 opacity.

Params:

Name Type Description
color string Color as a string.
opacity number Color opacity.

Returns:

anychart.core.ui.Table.Cell - anychart.core.ui.Table.Cell instance for method chaining.

Try it:

Linear gradient fill.
Learn more about coloring at: https://docs.anychart.com/7.3.1/General_settings/Elements_Fill

Params:

Name Type Description
keys Array.<(anychart.graphics.vector.GradientKey|string)> Gradient keys.
angle number Gradient angle.
mode boolean | anychart.graphics.vector.Rect | Object Gradient mode.
opacity number Gradient opacity.

Returns:

anychart.core.ui.Table.Cell - anychart.core.ui.Table.Cell instance for method chaining.

Try it:

Radial gradient fill.
Learn more about coloring at: https://docs.anychart.com/7.3.1/General_settings/Elements_Fill

Params:

Name Type Description
keys Array.<(anychart.graphics.vector.GradientKey|string)> Color-stop gradient keys.
cx number X ratio of center radial gradient.
cy number Y ratio of center radial gradient.
mode anychart.graphics.math.Rect If defined then userSpaceOnUse mode, else objectBoundingBox.
opacity number Opacity of the gradient.
fx number X ratio of focal point.
fy number Y ratio of focal point.

Returns:

anychart.core.ui.Table.Cell - anychart.core.ui.Table.Cell instance for method chaining.

Try it:

Image fill.
Learn more about coloring at: https://docs.anychart.com/7.3.1/General_settings/Elements_Fill

Params:

Name Type Description
imageSettings anychart.graphics.vector.Fill Object with settings.

Returns:

anychart.core.ui.Table.Cell - anychart.core.ui.Table.Cell instance for method chaining.

Try it:

getBounds

Returns cell bounds without padding counted (bounds which are used for borders drawing).

Returns:

anychart.math.Rect -

Try it:

getCol

Returns current cell column number.

Returns:

number -

getRow

Returns current cell row number.

Returns:

number -

leftBorder

Getter for current cell left border settings.

Returns:

anychart.graphics.vector.Stroke - Current stroke settings.
Setter for cell left border settings.
Learn more about stroke settings: https://docs.anychart.com/7.3.1/General_settings/Elements_Stroke
Note: Pass null to reset to default settings.
Note: lineJoin settings not working here.

Params:

Name Type Default Description
strokeOrFill anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
Fill settings or stroke settings.
thickness number
1
Line thickness.
dashpattern string
Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCap anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.ui.Table.Cell - anychart.core.ui.Table.Cell instance for method chaining.

Try it:

padding

Getter for current cell padding settings.

Returns:

anychart.core.utils.Padding - anychart.core.utils.Padding instance for method chaining.
Setter for current cell paddings in pixels using a single value.

Params:

Name Type Description
value null | Array.<(number|string)> | Object Value to set.

Returns:

anychart.core.ui.Table.Cell - anychart.core.ui.Table.Cell instance for method chaining.
Setter for current cell paddings in pixels using several numbers.

Params:

Name Type Description
value1 string | number Top or top-bottom space.
value2 string | number Right or right-left space.
value3 string | number Bottom space.
value4 string | number Left space.

Returns:

anychart.core.ui.Table.Cell - anychart.core.ui.Table.Cell instance for method chaining.

rightBorder

Getter for current cell right border settings.

Returns:

anychart.graphics.vector.Stroke - Current stroke settings.
Setter for cell right border settings.
Learn more about stroke settings: https://docs.anychart.com/7.3.1/General_settings/Elements_Stroke
Note: Pass null to reset to default settings.
Note: lineJoin settings not working here.

Params:

Name Type Default Description
strokeOrFill anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
Fill settings or stroke settings.
thickness number
1
Line thickness.
dashpattern string
Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCap anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.ui.Table.Cell - anychart.core.ui.Table.Cell instance for method chaining.

Try it:

rowSpan

Getter for cell rows span.

Returns:

number - Current rows span.
Setter for cell rows span.
Note: Cells that are overlapped by other cells are not drawn.

Params:

Name Type Default Description
value number
1
Count of cells to merge down.

Returns:

anychart.core.ui.Table.Cell - anychart.core.ui.Table.Cell instance for method chaining.

Try it:

topBorder

Getter for current cell top border settings.

Returns:

anychart.graphics.vector.Stroke - Current stroke settings.
Setter for cell top border settings.
Learn more about stroke settings: https://docs.anychart.com/7.3.1/General_settings/Elements_Stroke
Note: Pass null to reset to default settings.
Note: lineJoin settings not working here.

Params:

Name Type Default Description
strokeOrFill anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
Fill settings or stroke settings.
thickness number
1
Line thickness.
dashpattern string
Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCap anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.ui.Table.Cell - anychart.core.ui.Table.Cell instance for method chaining.

Try it: