cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
vheber
Level II

How to Set Cell Height or Text Wrapping in a Table Box

I'm trying to display some information in a Table Box in a display window. The text in one cell is so long that it extends the column width but does not wrap the text to extend the cell height. Is there a way to change this in the script so that the cell is taller and not wider?

 

This is an example of my current script:

 

longstring =
"In the loveliest town of all, where the houses were white and high \!Nand the elms trees were green and higher than the houses, where the front yards were \!Nwide and pleasant and the back yards were bushy and worth finding out about, \!Nwhere the streets sloped down to the stream and the stream flowed \!Nquietly under the bridge, where the lawns ended in orchards and the orchards ended \!Nin fields and the fields ended in pastures and the pastures climbed the hill and \!Ndisappeared over the top toward the wonderful wide sky, \!Nin this loveliest of all towns Stuart stopped to get a drink of sarsaparilla.";
string2 = "The End.";
nw = New Window( "Display",
	tb = Table Box(
		string_col1 = String Col Box( "MyString", {longstring} ),
		string_col2 = String Col Box( "Column2", {string2} )
	)
);

 

 

Display on One Line.JPG

I've tried Set Height, Set Width, and Set Min/Max Size, but haven't found a way to get the cell any taller than one line. Open to suggestions, thanks!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to Set Cell Height or Text Wrapping in a Table Box

String Col Box does not support multiple lines within a single row. However, you can use a Col Box and append Text Boxes for each row for columns that need to span multiple rows.

Here's an updated version of your example. Note that the only way to add display boxes to a Col Box is using Append. We expect to add more flexibility to this in a future release of JMP.

 

longstring = "In the loveliest town of all, where the houses were white and high and the elms trees were green and higher than the houses, where the front yards were wide and pleasant and the back yards were bushy and worth finding out about, where the streets sloped down to the stream and the stream flowed quietly under the bridge, where the lawns ended in orchards and the orchards ended in fields and the fields ended in pastures and the pastures climbed the hill and disappeared over the top toward the wonderful wide sky, in this loveliest of all towns Stuart stopped to get a drink of sarsaparilla.";
string2 = "The End.";
nw = New Window( "Display",
	tb = Table Box(
		col1 = Col Box( "MyString" ),
		col2 = String Col Box( "Column2", {string2} )
	)
);

col1 << append( Text Box( longstring , <<set wrap( 350 ) ) );

Here is the resulting window:

 

Capture.PNG

Justin

View solution in original post

5 REPLIES 5
txnelson
Super User

Re: How to Set Cell Height or Text Wrapping in a Table Box

Here is the example from the Scripting Index

     Help==>Scripting Index==>Data Table==>Set Cell Height

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Set Cell Height( 20 );
Jim
txnelson
Super User

Re: How to Set Cell Height or Text Wrapping in a Table Box

Oops.....I read Data Table, not Table Box.....my error

Jim

Re: How to Set Cell Height or Text Wrapping in a Table Box

String Col Box does not support multiple lines within a single row. However, you can use a Col Box and append Text Boxes for each row for columns that need to span multiple rows.

Here's an updated version of your example. Note that the only way to add display boxes to a Col Box is using Append. We expect to add more flexibility to this in a future release of JMP.

 

longstring = "In the loveliest town of all, where the houses were white and high and the elms trees were green and higher than the houses, where the front yards were wide and pleasant and the back yards were bushy and worth finding out about, where the streets sloped down to the stream and the stream flowed quietly under the bridge, where the lawns ended in orchards and the orchards ended in fields and the fields ended in pastures and the pastures climbed the hill and disappeared over the top toward the wonderful wide sky, in this loveliest of all towns Stuart stopped to get a drink of sarsaparilla.";
string2 = "The End.";
nw = New Window( "Display",
	tb = Table Box(
		col1 = Col Box( "MyString" ),
		col2 = String Col Box( "Column2", {string2} )
	)
);

col1 << append( Text Box( longstring , <<set wrap( 350 ) ) );

Here is the resulting window:

 

Capture.PNG

Justin
vheber
Level II

Re: How to Set Cell Height or Text Wrapping in a Table Box

This did it! Thank you for the quick reply!
aekw0
Level II

Re: How to Set Cell Height or Text Wrapping in a Table Box

Is it still not possible to Set Wrap to the String Col Box?

I have a table consisting of 2 columns (String Col Box) and 24 rows I would need to wrap the text in 3 out of 48 cells to make the table fit on one page of the pdf (resulting from saving a journal). I am not sure if the above solution could help with my problem...