aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes Table problem ! Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Table problem !" Watch "Table problem !" New topic
Author

Table problem !

Frank Jacobsen
Ranch Hand

Joined: May 17, 2002
Posts: 331
I have a table that looks like this:

|test 1 |test4|
|test 2|test4|
|test3|test5|

the code looks like this:


<%
String style = "clsContentCellB";

%>

<table width="100%" cellspacing="0" cellpadding="0" border="0">


<tr>
<td colspan="0" class="<%=style%>">
<span class="clsTxtNormalC"> Kortnr. </span>
</td>
<td colspan="0" class="<%=style%>">
<span class="clsTxtNormalC"><%= vb.getKortNr() %> </span>
</td>
<td colspan="0" class="<%=style%>">
<span class="clsTxtNormalC"><%= vb.getKundeNavn() %> </span>
</td>
</tr>


</table>

Can i in any way tell the table, that the each cell can�t be longer than the longest cell so my result looks like this:

|test 1 |test4 |
|test 2|test 4|
|test3|test5 |



Frank Jacobsen
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50679

HTML issues are discussed in the HTML/Javascript forum.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
I have no clue what you are talking about...

You can set the width of the cells, you can set the width of the table....
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi Frank,
there are a couple of things you should do:
1) Remove the width=100% from the table, that does the trick for you
2) Consider to remove the <span> tags, the class definition would be just fine in the <td>.
3) Put thead/tbody into the table to make it xhtml compliant (good for JavaScript DOM methods as well).
Hth
;-) stw
 
 
subject: Table problem !
 
Threads others viewed
Internationalization login thru to...
XSLT: Transformer Configuration Exception
Need Help with Jquery Selector logic
How to Introduce a Button That Controls All Other Links in a Web Page
layout and multibrowser hell
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com