Jump to content
  • How to create hyperlinks in Cross Tables

    A known restriction of Spotfire is that URL or hyperlinks can be applied within a flat table but not in a Cross Table. Generally, once a table is transformed to a Cross Table  visualization, hyperlinks will be presented as text, not as links.

    There is a way to convert the text in a cross table to hyperlinks using some JavaScript.


    The main prerequisite is only one table per page, and that you pre-load JQuery, as per: 

    In order to use JavaScript code, you need to create a text area. You can move it very far from the cross table and make it very small in order not to consume the report space. Then attach the following JS script to the text area.

    The main idea is to loop over cross-table cell values using jQuery and if the value contains "https" then the href attribute is applied. The listener is used to catch changes in div element as the script is launched before the cross table is loaded.

    var changeListener = function (event) {
        $(".sf-element-tabular-content div.sf-element-table-cell div.cell-text").each(function () {
            var cell_text = $(this).text();
            if (cell_text.includes("https") > 0) {
                $(this).replaceWith('<a href="' + cell_text + '" target="_blank"> ' + cell_text + "</a>");
    var userSelection = document.getElementsByClassName("sf-element-tabular-content");
    for (var i = 0; i < userSelection.length; i++) {
        userSelection[i].addEventListener("DOMSubtreeModified", changeListener, false);





    User Feedback

    Recommended Comments

    There are no comments to display.

  • Create New...