Search Results for

    Show / Hide Table of Contents

    TExcelFile.SetCellFromHtml Method

    Overloads

    • TExcelFile.SetCellFromHtml(Integer, Integer, string)
    • TExcelFile.SetCellFromHtml(Integer, Integer, string, Integer)

    TExcelFile.SetCellFromHtml(Integer, Integer, string)

    Enters an HTML formatted string into a cell, and tries to match the Excel formats with the HTML formatting tags. Note that the rich text inside Excel is more limited than xls (you are limited to only changing font attributes), so many tags from the HTML tags might be ignored. Whenever a tag is not understood or cannot be mapped into Excel, it will just be omitted. For a list of supported tags, see the Remarks section.

    Remarks

    Any tag (between brackets) will be stripped from the entered text. If you want to enter a < sign, you need to enter "&lt;". For a list of all "&" possible symbols consult any HTML reference. &[HexadecimalUnicodeCharacer] are supported too.

    All tags are case insensitive.

    Spaces will be eliminated from the string as in normal HTML. To enter a "hard" space you can enter "&nbsp;" (non breaking space). Also, if text is inside "pre" tags, spaces will be preserved.

    The supported tags are:

    • b or strong - Bold.
    • i or em- Italics.
    • u - Underline.
    • s or strike- Strikeout.
    • sub - Subscript.
    • sup - Superscript.
    • tt - Use monospace font.
    • pre - Preserve spaces and returns. On normal mode, if you have 2 spaces on a string, only one will be kept.
    • font - Change the used font. This tag behaves as normal HTML, and you can specify color, face, point-size or size as attributes. Size might be between 1 and 7, and the size in points are 8, 9, 12, 14, 18, 24, 34 for each size. You can also specify relative sizes (for example -1)
    • h1..h6 - Header fonts.
    • small - Use a smaller font. This is equivalent to <font size = '-1'>
    • big - Use a bigger font. This is equivalent to <font size = '+1'>
    • ul - Unordered list.
    • ol - Ordered list.
    • li - List item.

    Syntax

    Unit: FlexCel.Core

    procedure TExcelFile.SetCellFromHtml(const row: Integer; const col: Integer; const htmlText: string); overload;

    Parameters

    <-> Parameter Type Description
    const row Integer Cell Row (1 based)
    const col Integer Cell Column (1 based)
    const htmlText string Text with an HTML formatted string.

    See also

    • TExcelFile

    TExcelFile.SetCellFromHtml(Integer, Integer, string, Integer)

    Enters an HTML formatted string into a cell, and tries to match the Excel formats with the HTML formatting tags. Note that the rich text inside Excel is more limited than xls (you are limited to only changing font attributes), so many tags from the HTML tags might be ignored. Whenever a tag is not understood or cannot be mapped into Excel, it will just be omitted. For a list of supported tags, see the Remarks section.

    Remarks

    Any tag (between brackets) will be stripped from the entered text. If you want to enter a < sign, you need to enter "&lt;". For a list of all "&" possible symbols consult any HTML reference. &[HexadecimalUnicodeCharacer] are supported too.

    All tags are case insensitive.

    Spaces will be eliminated from the string as in normal HTML. To enter a "hard" space you can enter "&nbsp;" (non breaking space). Also, if text is inside "pre" tags, spaces will be preserved.

    The supported tags are:

    • b or strong - Bold.
    • i or em- Italics.
    • u - Underline.
    • s or strike- Strikeout.
    • sub - Subscript.
    • sup - Superscript.
    • tt - Use monospace font.
    • pre - Preserve spaces and returns. On normal mode, if you have 2 spaces on a string, only one will be kept.
    • font - Change the used font. This tag behaves as normal HTML, and you can specify color, face, point-size or size as attributes. Size might be between 1 and 7, and the size in points are 8, 9, 12, 14, 18, 24, 34 for each size. You can also specify relative sizes (for example -1)
    • h1..h6 - Header fonts.
    • small - Use a smaller font. This is equivalent to <font size = '-1'>
    • big - Use a bigger font. This is equivalent to <font size = '+1'>
    • ul - Unordered list.
    • ol - Ordered list.
    • li - List item.

    Syntax

    Unit: FlexCel.Core

    procedure TExcelFile.SetCellFromHtml(const row: Integer; const col: Integer; const htmlText: string; const XF: Integer); overload; virtual; abstract;

    Parameters

    <-> Parameter Type Description
    const row Integer Cell Row (1 based)
    const col Integer Cell Column (1 based)
    const htmlText string Text with an HTML formatted string.
    const XF Integer Format for the cell. It can be -1 to keep the existing format.

    See also

    • TExcelFile
    In This Article
    Back to top FlexCel Studio for VCL and FireMonkey v7.24
    © 2002 - 2025 tmssoftware.com