cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar

Set Width / Set Wrap in a data table box column

Hello,

 

I have a table that I'd like to display in a window using a table box. The problem is that some of the columns in this table are very wide (because they contain very long text values) and the user has to scroll horizontally to see the whole table.

I've seen that I can apply Set width normally to my column, but that doesn't change anything. Ideally I'd like to apply a set wrap too so that the text comes back on the line and I can adjust the width as I like without losing any information.

 

Has anyone had this problem?

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "Long set",
	character,
	"Nominal",
	<<Set Each Value( "loooooooooooooooooooooooooooooooooooooooooooooooong teeeeeeeeeeeeeeeeeext" )
);

New Window( "Example", Data Table Box( dt ) );

Window("Example")[DataTableColBox(6)] << set width(150)
1 ACCEPTED SOLUTION

Accepted Solutions
mmarchandFSLR
Level IV

Re: Set Width / Set Wrap in a data table box column

I haven't seen a better solution than in this post.  Surprising we still don't have the <<Set Width ability.

 

Names Default to Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "Long set", character, Set Each Value( "loooooooooooooooooooooooooooooooooooooooooooooooong teeeeeeeeeeeeeeeeeext" ) );
lsvals = Transform Each( {v, i}, dt:Long set << Get Values, Text Box( v, <<Set Wrap( 150 ) ) );
New Window( "Example",
	Table Box(
		String Col Box( "name", :name << Get Values ),
		Number Col Box( "age", :age << Get Values ),
		String Col Box( "sex", :sex << Get Values ),
		Number Col Box( "height", :height << Get Values ),
		Number Col Box( "weight", :weight << Get Values ),
		Col Box( "Long set" )
	)
);
For Each( {v, i}, lsvals, Get Window( "Example" )[Col Box( 1 )] << Append( v ) );

View solution in original post

2 REPLIES 2
mmarchandFSLR
Level IV

Re: Set Width / Set Wrap in a data table box column

I haven't seen a better solution than in this post.  Surprising we still don't have the <<Set Width ability.

 

Names Default to Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "Long set", character, Set Each Value( "loooooooooooooooooooooooooooooooooooooooooooooooong teeeeeeeeeeeeeeeeeext" ) );
lsvals = Transform Each( {v, i}, dt:Long set << Get Values, Text Box( v, <<Set Wrap( 150 ) ) );
New Window( "Example",
	Table Box(
		String Col Box( "name", :name << Get Values ),
		Number Col Box( "age", :age << Get Values ),
		String Col Box( "sex", :sex << Get Values ),
		Number Col Box( "height", :height << Get Values ),
		Number Col Box( "weight", :weight << Get Values ),
		Col Box( "Long set" )
	)
);
For Each( {v, i}, lsvals, Get Window( "Example" )[Col Box( 1 )] << Append( v ) );

Re: Set Width / Set Wrap in a data table box column

Thank you very much ! I will add the proposal of set width to the wishlist if it does not already exist