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

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.

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.)

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

Joined: Mar 22, 2005
Posts: 42954

73

posted Sep 11, 2008 02:42:00

0

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.

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.