This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No Horizontal Scroll Bar

 
sudha swami
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 471
Hibernate Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Alaa Nassef
Ranch Hand
Posts: 471
Hibernate Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic