ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

Listbox cell disable wrapping ?

umanga
18 Dec 2008 04:37:28 GMT
18 Dec 2008 04:37:28 GMT

Greetings,

(Please refer to image at http://umanga.ifreepages.com/images/listbox1.png )

I have a listbox.But as you can see the cells in the column 'Epitope sequence' are wrapped.
In the cells I have added Html code something similar to:

Html html=Html();
html.setContent("<pre><span style='color:black;background-color:LightBlue'>LTEVETPIRNEWG</span></pre>");
aCell.appendChild(html);

When I remove the <prev> tag in Html , I get the desired output,ie checkbox and the html in the same row,whitout wrapping.
Is there a way to accomplish this with <prev> tag? I want checkbox and the text in the same line.

thanks in advance.

henrichen
19 Dec 2008 03:31:58 GMT
19 Dec 2008 03:31:58 GMT

May I ask why you need the <pre> tag? It is a block tag (something like <div>) and will change line. Per your example, it seems you don't need the <pre> at all.

umanga
19 Dec 2008 04:04:54 GMT
19 Dec 2008 04:04:54 GMT

I want to keep the fixed distance between characters.
Say, I have a sequence like "C...." and "CAAAA" ,both have same number of characters.
Without <pre> tag , first sequence will occupy small width than the second sequence.

henrichen
19 Dec 2008 09:28:44 GMT
19 Dec 2008 09:28:44 GMT

Use monospace font:

<span style='color:black;background-color:LightBlue;font-family:monospace'>CAAAA</span>

umanga
19 Dec 2008 09:39:44 GMT
19 Dec 2008 09:39:44 GMT

Thanks henrichen,
It worked!