Search code examples
ironpythonspotfire

Iron Python How to justify left right or center in Table or CrossTable


Thanks in advance.

I am using Iron Python to load data into visualization. sometimes, it is Table, sometimes, it is CrossTable.

The requirement is all the data and labels should be left justified in some visualizations and centered in some others.

How to justify using Iron Python?

Thanks.


Solution

  • this is not possible using IronPython.

    You can still achieve what you want using CSS code inside a TextArea but note that this can stop working in future version of spotfire as support is not guaranted (it edits internal Spotfire comportment). It will also affect the whole page on which you put the display, and not only one table.

    Insert a TextArea (inside the visualization toolbar). Then right click and click on edit HTML. Add the code below and save.

    To align left :

    <STYLE>
    .flex-justify-center {
        -webkit-justify-content: flex-start;
        justify-content: flex-start;
        -ms-flex-pack: start;
    }
    .flex-justify-end {
        -webkit-justify-content: flex-start;
        justify-content: flex-start;
        -ms-flex-pack: start;
    }
    <STYLE>
    

    To align center :

    <STYLE>
    .flex-justify-start {
        -webkit-justify-content: flex-center;
        justify-content: flex-center;
        -ms-flex-pack: center;
    }
    .flex-justify-end {
        -webkit-justify-content: flex-center;
        justify-content: flex-center;
        -ms-flex-pack: center;
    }
    <STYLE>