Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table Formating

Status
Not open for further replies.

Karl Blessing

Programmer
Feb 25, 2000
2,936
US
Right now I have a list of stuff being spit out, and processed to the screen, I got one column into a table, what I want to do is count upto 18 lines(I'll keep count) then when I hit that, I need to know how to start another column instead of just another row, is there any way to create a second column in a table, after you have already created rows. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
Dear Karl,<br><br>Well of course you can just put them in there. You may not be happy with the different browsers rendering of mismatched columns though. Or am I misunderstanding your question? You can do this.<br><br>&lt;table border=1&gt;&lt;tr&gt;&lt;td&gt;R1,C1&lt;/td&gt;&lt;/tr&gt;<br>&lt;tr&gt;&lt;td&gt;R2,C1&lt;/td&gt;&lt;/tr&gt;<br>&lt;tr&gt;&lt;td&gt;R3,C1&lt;/td&gt;&lt;td&gt;R3,C2&lt;/td&gt;&lt;/tr&gt;<br>&lt;tr&gt;&lt;td&gt;R4,C1&lt;/td&gt;&lt;td&gt;R4,C2&lt;/td&gt;&lt;/tr&gt;<br>&lt;/table&gt;<br><br>All the cells should display. Will you like the layout? I dunno!<br><br>-pete
 
what I needed to do was go through the listing, fill up a bunch of &lt;TD&gt; but rows as well(so they wouldnt go across, then when the first column reaches it's limit, the second column starts, in any case this is what i did so far to get around the prob<br><br><FONT FACE=monospace><br>&lt;%showtreeat AryData, 0,0, False%&gt; <br>&lt;form action=&quot;FormatMulti.asp&quot; method=&quot;Post&quot;&gt;<br>&nbsp;&nbsp;&lt;Table border=0 align=center Width=&quot;80%&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;&lt;TD &lt;% =gTopColor %&gt;&nbsp;&nbsp;align=center valign=middle colspan=2&gt; &lt;H1&gt; Multiple Report Print Query &lt;/H1&gt; &lt;/TD&gt;&lt;/TR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;<br><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD valign=top &lt;%=gTableCellColor%&gt;&gt;&lt;Table border=0 width=&quot;100%&quot;&gt;&lt;%=HTMLStr1%&gt;&lt;/Table&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD valign=top &lt;%=gTableCellColor%&gt;&gt;&lt;Table border=0 width=&quot;100%&quot;&gt;&lt;%=HTMLStr%&gt;&lt;/Table&gt;&lt;/TD&gt;<br></b>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;TR&gt;&lt;TD &lt;% = gBottomColor %&gt;&nbsp;&nbsp;align=center valign=middle colspan=2&gt; &lt;input type=&quot;Submit&quot; id=Submit1 name=Submit1&gt; &lt;/TD&gt;&lt;/TR&gt;<br>&nbsp;&nbsp;&lt;/Table&gt;<br>&lt;/form&gt;<br></font><br><br>Basically what I did was change the showtreeat function to stick all the HTML returned into a string rather than response.write, as a result, I set how many lines until, it puts the HTMLStr into HTMLStr1 and resets HTMLStr (only 2 columns, after it has hit this limit, it will not try to break again)<br><br>that way, all the TreeView is split off near the middle.<br>of course this required me writing alot more. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
Karl,<br><br>You've been working on this 'tree' thing for quite some time now. Earlier I mentioned using an Object Oriented approach to solve this problem. It entailed using a 'node' class and collections. I didn't just make that up in my head. <br><br>I actually authored a tree view using that technique last month, in Javascript of course. The whole thing took me about four days. The amount of code is very small and the object orient design provides code reuse such that different sorted views of the tree could easily be provided assuming the data supported the sorting mechanism.<br>Also different links from the tree nodes can be provided through inheritance as well.<br><br>-pete
 
basically it presents itself as a tree, but the problem is , I got it in an array, and i sort through the array , well look at the function.<br><br><FONT FACE=monospace><br>sub showtreeat(byref theObj, HpLoc, LpLoc, ShowP)<br>&nbsp;&nbsp;Dim TreeRow<br>&nbsp;&nbsp;TreeRow = UBound(theObj, 2)<br>&nbsp;&nbsp;if ShowP = true then<br>&nbsp;&nbsp;&nbsp;&nbsp;showparent theObj, HpLoc, LpLoc<br>&nbsp;&nbsp;end if<br>&nbsp;&nbsp;for j = 0 to TreeRow<br>&nbsp;&nbsp;&nbsp;&nbsp;If theObj(HP,j) = HpLoc and theObj(LP,j) = LpLoc then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if Spaces = 0 and count &gt; 45 and Change=True then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Change = False<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HTMLStr1 = HTMLStr<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HTMLStr = &quot;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end if <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if theObj(RType,j) &lt;&gt; &quot;DataGroup&quot; then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HTMLStr = HTMLStr & &quot;&lt;TR&gt;&lt;TD &quot; & gTableCellColor & &quot;&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writetabs(Spaces)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HTMLStr = HTMLStr & vbcrlf & &quot;&lt;input type=&quot;&quot;&quot; & TheObj(RType, j) & &quot;&quot;&quot; name=&quot;&quot;&quot; & TheObj(Name, j) & &quot;&quot;&quot; value=&quot;&quot;&quot; & TheObj(Value,j) & &quot;&quot;&quot;&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HTMLStr = HTMLStr & TheObj(Label, j) & &quot;&lt;/TD&gt;&lt;/TR&gt;&quot; & vbcrlf & vbcrlf<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Count = Count + 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select case theObj(Label,j)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case &quot;ESA&quot;, &quot;RM&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set objDB = WebConn()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if theObj(Label,j) = &quot;ESA&quot; then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set gRS = objDB.EsDataGroup(1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set gRS = objDB.ProgCompGroup(1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end if<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if not (gRS is nothing) and not (gRS.EOF) then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gRS.MoveFirst<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do While Not gRS.EOF<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HTMLStr = HTMLStr & &quot;&lt;TR&gt;&lt;TD &quot; & gTableCellColor & &quot;&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writetabs(Spaces)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HTMLStr = HTMLStr & vbcrlf & &quot;&lt;input type=&quot;&quot;&quot; & TheObj(Value, j) & &quot;&quot;&quot; name=&quot;&quot;&quot; & theObj(HID,j) & &quot;_code&quot;&quot; value=&quot;&quot;&quot; & Trim(gRS(&quot;codetype&quot;)) & &quot;~&quot; & Trim(gRS(&quot;groupcode&quot;)) & &quot;&quot;&quot;&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HTMLStr = HTMLStr & gRS(&quot;grouptitle&quot;) & &quot;&lt;/TD&gt;&lt;/TR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nbsp;&nbsp;&nbsp;OccVal = &quot;_code&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set gRS = objDB.Sicdiv()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OccVal = &quot;_ind_grp&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end if<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if not (gRS is nothing) and not (gRS.EOF) then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gRS.MoveFirst<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do While Not gRS.EOF<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HTMLStr = HTMLStr & &quot;&lt;TR&gt;&lt;TD &quot; & gTableCellColor & &quot;&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;writetabs(Spaces)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HTMLStr = HTMLStr & vbcrlf & &quot;&lt;input type=&quot;&quot;&quot; & TheObj(Value, j) & &quot;&quot;&quot; name=&quot;&quot;&quot; & theObj(HID,j) & OccVal & &quot;&quot;&quot; value=&quot;&quot;&quot; & gRS(0) & &quot;&quot;&quot;&gt;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HTMLStr = HTMLStr & gRS(1) & vbcrlf & &quot;&lt;/TD&gt;&lt;/TR&gt;&quot; & vbcrlf & vbcrlf<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gRS.MoveNext<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Count = Count + 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Loop<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gRS.Close<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end if<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WebDisConn(objDB) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end select<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end if<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Spaces = Spaces + 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;showtreeat theObj, theObj(HID, j), theObj(LID, j),&nbsp;&nbsp;False<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Spaces = Spaces - 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end if<br>&nbsp;&nbsp;&nbsp;&nbsp;next<br>end sub<br></font><br><br>I have to perform several different things, for example some of the &quot;nodes&quot; wont even be comming from my database, and come from a different database, as long as all the variables and their values are managed to pass over, I can still send all the URLS to the print page to merge all the HTMLs. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
My (mini) project has three parts, so far so good, just need to work up on the UI<br><br>1) (MultiTree.asp)Presentation and selection of the reports to be printed<br>2) (FormatMulti)[not seen by user; redirects] decodes form data sent over, and creates the URLs with the filters attached from selections, then sents it to the print page<br>3) (print4.asp)[not created by me, but modified to accept my Multireport print] Takes the list of URLS using an ActiveX dll (which I have no knowledge of) and retreives the HTML of each page, then spits out all the reports into a single print-friendly page. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
How would I create the &quot;nodes&quot; from the array i get back from the GetRows, it would at least help speed up my application by jumping to a Node with the keyvalue of the parents I am looking for and just search through it's children, rather than calling the function again and search throught the entire array again(I'll still keep it rescursive, but find it faster to just call it at that KeyName) <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
hmm that would also help me control the user interface a bit, for example, if someone clicks one of the root catagories, the first options are automatically chosen, or if someone clicks one of the options, the root catagory turnes to checked, or if someone clicks the suboption underneath another option, but under the same catagorie, that option becomes chosen. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top