This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes No Horizontal Scroll Bar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "No Horizontal Scroll Bar" Watch "No Horizontal Scroll Bar" New topic
Author

No Horizontal Scroll Bar

sudha swami
Ranch Hand

Joined: Apr 24, 2007
Posts: 179
Hi,
I am using the following HTML in the Struts tiles but i am not getting horizontal scroll bar.

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="115%" id="AutoNumber1" height="38">
<tr>
<td width="6%" height="19"> </td>
<td width="4%" height="19"> </td>
<td width="5%" height="19"> </td>
<td width="5%" height="19"> </td>
<td width="3%" height="19"> </td>
<td width="4%" height="19"> </td>
<td width="4%" height="19"> </td>
<td width="3%" height="19"> </td>
<td width="8%" height="19"> </td>
<td width="8%" height="19"> </td>
<td width="7%" height="19"> </td>
<td width="4%" height="19"> </td>
<td width="3%" height="19"> </td>
<td width="4%" height="19"> </td>
<td width="4%" height="19"> </td>
<td width="4%" height="19"> </td>
<td width="10%" height="19"> </td>
<td width="3%" height="19"> </td>
<td width="11%" height="19"> </td>
</tr>
<tr>
<td width="6%" height="18">MERLIN</td>
<td width="4%" height="18">AREA</td>
<td width="5%" height="18">DISTRICT</td>
<td width="5%" height="18">SITE</td>
<td width="3%" height="18">CPA</td>
<td width="4%" height="18">CS</td>
<td width="4%" height="18">QEIM</td>
<td width="3%" height="18">IPA</td>
<td width="8%" height="18">System Test</td>
<td width="8%" height="18">Dust Detection</td>
<td width="7%" height="18">Go / No Go</td>
<td width="4%" height="18">CPA</td>
<td width="3%" height="18">IPA</td>
<td width="4%" height="18">CS</td>
<td width="4%" height="18">QEIM</td>
<td width="4%" height="18">CPA</td>
<td width="10%" height="18">CPA Postal Tables</td>
<td width="3%" height="18">IPA</td>
<td width="11%" height="18">Communication</td>
</tr>
<tr>
<td width="6%" height="18"><font SIZE="2">MER-00-0001</font><p> </td>
<td width="4%" height="18">CM</td>
<td width="5%" height="18">BALTIMORE</td>
<td width="5%" height="18">BALTIMORE</td>
<td width="3%" height="18"></td>
<td width="4%" height="18"></td>
<td width="4%" height="18"></td>
<td width="3%" height="18"></td>
<td width="8%" height="18"></td>
<td width="8%" height="18"></td>
<td width="7%" height="18"></td>
<td width="4%" height="18"></td>
<td width="3%" height="18"></td>
<td width="4%" height="18"></td>
<td width="4%" height="18"></td>
<td width="4%" height="18"></td>
<td width="10%" height="18"></td>
<td width="3%" height="18"></td>
<td width="11%" height="18"></td>
</tr>
</table>

Any help is appreciated in this.

regards
sudha
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 460
Well, since you are using tiles, I suspect that this table is included within a cell of another table defined by the main layout of the page. This means that the 115% you defined is 115% of the cell's width, not that of the screen. Since the cell has a defined width, the extra 15% of the table are going to be cropped out.

By the way, why do you WANT a horizontal scroll? This is against all the standards of user friendly sites. If you NEED a scroll bar for a big report for example, I believe putting the table in a different frame/iframe is better than a horizontal scroll bar in the browser. Also, in this case, defining absolute widths for the table and the columns would be a lot better than using percentages of the window size. Imagine if you try to open this page on 800*600 and on 1280*1024 resolutions. Do you need to have 115% for both? Fixed width in this case is a lot better.
[ February 14, 2008: Message edited by: Alaa Nassef ]

Visit my blog: http://jnassef.blogspot.com/
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 460
Oh, I have one more comment. To produce cleaner and smaller code, I suggest you use the <colgroup> and the <col> attributes to configure the way your columns look, so you will not have to set the width for each and every cell. As for the height, you can put it in the <tr> instead of the <td>, also to reduce the amount of code. I also see that all of your rows are of the same height, so you can use css for that, which is better.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No Horizontal Scroll Bar
 
Similar Threads
Multiple Radio Objects
display in two seprate table
Table with fixed header and scolling body in Safari.
Why this problem???
Multiple forms in a single JSP page