Uncategorized

How to Force Button Labels to Wrap in Spotfire

We had a quick question on how to wrap buttons in Spotfire. Usually buttons come out like this when you don’t specify the length of the button.

But! If you specify specific dimensions, you’ll find that your button label will trail off into the distance like the button below.

We can employ some simple tricks in Spotfire to get this label to wrap. You’ll need to have the ability to write CSS scripts using the <style> tag. Your Spotfire administrator can turn this on for you. To begin, you’ll need to do the following:

  1. Create a text area.
  2. Create your button with the size you want.
  3. Open the text area into the HTML editor by right-clicking and selecting Edit HTML…

In the script below, you’ll want to add the <style> tag that I have listed below

The white-space property controls how text wraps inside the button. You’ll override this property to the “normal” way it works. The “!important” attribute overrides how Spotfire does this.

Presto! You’re all set.

1 thought on “How to Force Button Labels to Wrap in Spotfire

Leave a Reply

Your email address will not be published. Required fields are marked *