• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Supriya Pramod
Greenhorn
Posts: 10
Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
Supriya Pramod
Greenhorn
Posts: 10
Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you having a problem with exactly? How are you adding the row to the end?

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic