News in versions: FastGrid 1.0, TreeGrid 17.2

6. Cell style and border

Cell text and background style and border

Source: 06-Styles.js
  • Styles set to cell


    They are independent on the cell Type. All the attributes can be changed by users if set Cfg

    EditingStyle

    .

    TextStyle

    - sets bold and italic text.

    TextLine

    and

    TextLineColor

    - set text underline / strike / overline and the line style, color and width.

    TextSize

    - sets text font size and line height.

    TextFont

    - sets text font family.

    TextColor

    - sets text color.

    TextShadow

    - sets text background or shadow around or next to the text.

    Background

    - sets cell background color.

    Pattern

    and

    PatternColor

    - sets cell background pattern, gradient or line(s).

    Align

    - sets cell horizontal alignment and overflow side.

    VertAlign

    - sets cell vertical alignment.

    Wrap

    - sets wrapping text to more lines.

    Rotate

    - rotates text in 360 degrees.

    Indent

    - indents cell text from align side.

    RowBorder

    and

    ColBorder

    - sets border around the cell, sets edge(s), color, width and style.
  • Styles set to cell text


    They can be set only in Html Type. Or to Auto Type if set Cfg

    AutoHtml

    .
    All the HTML text attributes can be changed by users if the cell is editable.
    The styles are set in HTML code in the cell Value by standard <span> tags. Only text styles are permitted.
    • Permitted HTML tags: <span>, <b> / <strong> (font-weight:bold), <i> / <em> (font-style:italic), <u> / <ins> (text-decoration:underline), <s> / <strike> / <del> (text-decoration:line-through), <small> (font-size:10px), <code> (font-family:monospace), <br>, <a>.
    • Permitted CSS attributes: font-weight, font-style, font-variant, text-decoration, font-size, font-family, color, text-shadow.
    • Sub and super text can be done by vertical-align:50% /*super = 50%, sub = -50%*/; line-height:50%; optionally with font-size:85%.
  • All styles can be used and changed also in

    Toolbar

    cells, except RowBorder, ColBorder and Rotate.
  • To update row height according to style or html content set Cfg

    HtmlHeight

    .
    To calculate column width according to style or html content set Cfg

    HtmlWidth

    .
  • To update toolbar icons for editing styles according to actual selected text or focus set appropriate value to Cfg

    RecalcOn

    .
    The toolbars are not updated if editing is done in toolbar cell in the same row part.
  • Hyperlinks


    Hyperlink for whole cell can be set

    Link

    attribute, its target by

    Target

    and tooltip by

    LinkTip

    .
    Hyperlink for some text in cell value can be set by HTML tag

    <a>

    in Html or Auto type cell.
    To permit adding or changing links by users set Cfg

    EditingLink

    .
    Styling links in grid can be done by Cfg

    LinkCSS

    object attribute.