How to make a table with no wrap and no horizontal scroll

1.8k views Asked by At

I have a table with 8 columns. And the 3rd and 4th columns may have very long texts in it. This situation creates a horizontal scroll. What I want is that I want every column to have a fixed size, and I don't want the text inside columns to be wrapped and also don't want to have scroll bar. So if a column has a very long string for example "abcdefghijklmnop" it should show as much as possible without wrapping and without creating a scroll. So the text seen on the table may be something like "abcdefg"

Actually I am trying to do this in Eclipse BIRT, but it would be adequate if I can learn how to make this in html and CSS. Then I can adopt it to BIRT. By the way I don't want to check the size of the text with Javascript.

3

There are 3 answers

0
TiGoRn On

Format each column to have it's overflow value set to hidden and set the width.

0
maozturk On

Did you use CSS max-width?

CSS max-width

0
Sundar G On

For wrapping a text in BIRT you have to use the Dynamic Text which is in the palette window.It will automatically wrap the content.If problem occurs after adding the dynamic text you have to write a script for wrapping the content.

NOTE : whenever you are a writing a script in the report you need to change the dataSetRow["YOUR CLOUMN"] in to row["YOUR CLOUMN"] ie., first add a dynamic text and then write a script.here i have a script for your concern.

if (row["comments"]!=null && row["comments"]!=""){ var str = row["comments"]; var test = ""; var count=0; for(var i=0;i"; count=0; } } test; } } else{ row["comments"]; }

Here i have calculated the space b/w the characters, If the sentence contains more than 7 spaces the rest of the characters will wrap to the next line....