cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member
Introduction
when adding numeric dimension to pivot and table widgets in the rows section and not the value section (in cases where the numeric value is an attribute and not a measure) you can change the alignment of the number dimensions to the left using the below script:
 

BEFORE

AFTER

 Script
add this code to the widget's script:
widget.on('ready', function(sender, ev){
$('td[fidx=1]',element).css('text-align','left'); /// / Column 1
$('td[fidx=2]',element).css('text-align','left'); // Column 2
$('td[fidx=3]',element).css('text-align','left'); // Column 3
$('td[fidx=4]',element).css('text-align','right'); // Column 4
$('td[fidx=5]',element).css('text-align','left'); // Column 5
$('td[fidx=6]',element).css('text-align','left'); // Column 6
$('td[fidx=7]',element).css('text-align','left'); // Column 7
$('td[fidx=8]',element).css('text-align','left'); // Column 8
$('td[fidx=9]',element).css('text-align','left'); // Column 9
$('td[fidx=10]',element).css('text-align','left'); // Column 10
$('td[fidx=11]',element).css('text-align','left'); // Column 11
$('td[fidx=12]',element).css('text-align','left'); // Column 12
});
Comments
DrewGillow
9 - Travel Pro
9 - Travel Pro

years ago there was a script posted to automatically right align number columns so users could add, remove, hide, and rearrange their table widget and still get numbers to right align.  But that script seems to have stopped working with upgrades

This is what I found.  How do we get something that works with tables and piot tables?

/* Right Align numbers in the table */

widget.on('domready', function (a, b) {
            _.each ($('td', element), function (td) {
                        var $td = $(td);
                        if (!isNaN(parseFloat($td.text()))) {
                                    $td.css({ 'text-align': 'right' });
                        }
            });
});

 

Version history
Last update:
‎03-02-2023 09:13 AM
Updated by:
Contributors
Community Toolbox

Recommended quick links to assist you in optimizing your community experience:

Developers Group:

Product Feedback Forum:

Need additional support?:

Submit a Support Request

The Legal Stuff

Have a question about the Sisense Community?

Email [email protected]

Share this page: