aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Can the number of columns in a html table can be restricted Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Can the number of columns in a html table can be restricted" Watch "Can the number of columns in a html table can be restricted" New topic
Author

Can the number of columns in a html table can be restricted

Supriya Pramod
Greenhorn

Joined: Jun 19, 2008
Posts: 10

Hi all ,

I want to know wheather the number of columns in a html table can be restricted. as with panelGrid , v have an option to specify the number of columns , can the same be done with noraml html table?
Can any please suggest any way to accomplish this task.

Thanks in advance
Supriya
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
I don't think I understand the question. If you want only a certain number of columns, then just create that many. HTML is static text - if a table has N columns, then it'll keep having N columns. (That's assuming that you're not using some client-side JavaScript/DOM manipulation that might change it; in that case the maximum number of columns would need to be built into it the code.)


Ping & DNS - my free Android networking tools app
Supriya Pramod
Greenhorn

Joined: Jun 19, 2008
Posts: 10

Actually my issue is ,

I have some 8 sets of values which needs to be dispalyed as 8 columns(without any headers). Later when i add a new value , i want it to be continued in the next row as the first column , and then it should go on til 8. Likewise , every new set of 8 values should be a different row.
Can this be accomplished?

Thanks,
Supriya
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
When is "later" - after a page reload, or still on the same page? if the former, you can just create the page any you want on the server - no problem. If the latter, then you need to use JavaScript/DOM manipulation, and keep track of how many values are in the current row, so that you can start a new one after the eighth value in a row.
Supriya Pramod
Greenhorn

Joined: Jun 19, 2008
Posts: 10

Initially the page will have 6 or 8 values in a row.
the page also contains a add button. when i click on add , a textbox comes on the next column(i.e., after the last column). on save , it gets added as another column.Likewise , after evry 8 , a next row must come.

Thanks,
Supriya
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
What are you having a problem with exactly? How are you adding the row to the end?

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can the number of columns in a html table can be restricted