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!

TABs - How do I force one.? 1

Status
Not open for further replies.

rossmcl

Programmer
Apr 18, 2000
128
<br>How do I force a tab in the below<br><br>ie between the three recordset values<br><br><br>= rs5(&quot;Course&quot;) & vbCrLf & &quot; - &quot; & rs5(&quot;CourseDate&quot;) & &quot; - &quot; & rs5(&quot;Status&quot;)
 
chr(9) <p>nick bulka<br><a href=mailto:nick@bulka.com>nick@bulka.com</a><br><a href= > </a><br>
 
= rs5(&quot;Course&quot;) & chr(9) & rs5(&quot;CourseDate&quot;) & chr(9) & rs5(&quot;Status&quot;) <br><br>Advanced Powerpoint - 25/05/00 09:00:00 BookedOn&nbsp;&nbsp;<br>Advanced Outlook - 25/05/00 15:00:00 BookedOn&nbsp;&nbsp;<br>Advanced Word - 24/05/00 11:00:00 BookedOn&nbsp;&nbsp;<br>Basic Access - 25/05/00 09:00:00 BookedOn&nbsp;&nbsp;<br>Advanced Powerpoint - 25/05/00 09:00:00 BookedOn&nbsp;&nbsp;<br>Advanced Outlook - 25/05/00 15:00:00 BookedOn&nbsp;&nbsp;<br><br>It does not seem to work. Is there a better way to align this into columns.<br>Preferablly without using a table as I think that it doesnt look nice like that.<br>Any help much appreciated.<br>Riss
 
aligning columns using tabs in a web page won't work.&nbsp;&nbsp;A table is definitely the easiest way to do this.&nbsp;&nbsp;I'm not sure what it is about tables that you don't like,&nbsp;&nbsp;but if you insist on avoiding them, you're left with CSS positioning.&nbsp;&nbsp;However, if you do this,&nbsp;&nbsp;older browsers will have a problem. <p>nick bulka<br><a href=mailto:nick@bulka.com>nick@bulka.com</a><br><a href= > </a><br>
 
Can you bring in a recordset in a table so the columns are set lengths (varying with the rs.field)?<br><br>Also can you hide the table outline? And make the colours alternate between odd and even rows?<br><br>Sorry if this cant be done.<br><br>Thanks (as always)<br><br>Ross
 
Ross,<br>&nbsp;&nbsp;&nbsp;You can hide the table outline by adding BORDER=0 to your &lt;table&gt; tag.&nbsp;&nbsp;And yes, you can alternate colors by setting tha background color in your tags, or use CSS.<br>&nbsp;&nbsp;&nbsp;You really don't need all your values to be the same length.&nbsp;&nbsp;Just set the width of each table column.<br> <p>nick bulka<br><a href=mailto:nick@bulka.com>nick@bulka.com</a><br><a href= > </a><br>
 
Nick, Thanks for that. I have done the border, it works fine (thanks)<br>Regarding the setting field column lengths, is this possible with the below code, or would I have to rethink my strategy to build this table.<br>Thanks in Advance if you can assist me.<br>Ross<br><br><br>' Continue with a title row in our table<br>Response.Write &quot;&lt;TABLE BORDER=&quot;&quot;0&quot;&quot;&gt;&quot; & vbCrLf<br><br>' Show field names<br>Response.Write vbTab & &quot;&lt;TR&gt;&quot; & vbCrLf<br>For x = 1 To rs.Fields.Count<br>Response.Write vbTab & vbTab & &quot;&lt;TD&gt;&lt;B&gt;&quot;<br>Response.Write rs.Fields(x - 1).Name<br>Response.Write &quot;&lt;B&gt;&lt;/TD&gt;&quot; & vbCrLf<br>Next<br>Response.Write vbTab & &quot;&lt;/TR&gt;&quot; & vbCrLf<br><br>' Loop through our records<br>Do While rs.AbsolutePage = strPageCurrent And Not rs.EOF<br>Response.Write vbTab & &quot;&lt;TR&gt;&quot; & vbCrLf<br>For y = 1 To rs.Fields.Count<br>Response.Write vbTab & vbTab & &quot;&lt;TD&gt;&quot;<br>Response.Write rs.Fields(y - 1)<br>Response.Write &quot;&lt;/TD&gt;&quot; & vbCrLf<br>Next<br>Response.Write vbTab & &quot;&lt;/TR&gt;&quot; & vbCrLf<br><br>'Move to the next record!<br>rs.MoveNext<br>Loop
 
Ross,<br>&nbsp;&nbsp;&nbsp;You've got the general idea.&nbsp;&nbsp;A few tips:<br><br>- The vbtab characters will be treated as white space by the web server.&nbsp;&nbsp;you don't need them.<br>- instead of simulating a table header as you're doing, you should use the &lt;th&gt; tag.&nbsp;&nbsp;This will automatically bold and center the headers.<br>- If you're going to want to alternate colors, you probably won't want lines in between the columns, so your table tag will have to specify no padding or spacing.<br>- you can set the column width for each column in the &lt;TH&gt; tag, and the background color for each row in the &lt;TR&gt; tag.<br><br>Here's your code, with some minor modifications (I didn't actually run this code, so there might be some minor syntax changes, but you'll get the idea):<br><br>' Continue with a title row in our table<br>Response.Write &quot;&lt;TABLE BORDER=&quot;&quot;0&quot;&quot; CELLSPACING=&quot;&quot;0&quot;&quot; CELLPADDING=&quot;&quot;0&quot;&quot;&gt;&quot; & vbCrLf<br><br>' Show field names<br>Response.Write vbTab & &quot;&lt;TR&gt;&quot; & vbCrLf<br>For x = 1 To rs.Fields.Count<br>Response.Write vbTab & vbTab & &quot;&lt;TH width=70&gt;&quot;<br>Response.Write rs.Fields(x - 1).Name<br>Response.Write &quot;&lt;/TH&gt;&quot; & vbCrLf<br>Next<br>Response.Write vbTab & &quot;&lt;/TR&gt;&quot; & vbCrLf<br><br>' Loop through our records<br>Do While rs.AbsolutePage = strPageCurrent And Not rs.EOF<br>rowcounter = rowcounter + 1<br>if rowcounter/2 = rowcounter\2 then <br>&nbsp;&nbsp;&nbsp;&nbsp;bg=&quot;gray&quot;<br>else<br>&nbsp;&nbsp;&nbsp;&nbsp;bg=&quot;white&quot;<br>end if<br>Response.Write&nbsp;&nbsp;&quot;&lt;TR bgcolor=&quot; & bg & &quot;&gt;&quot; & vbCrLf<br>For y = 1 To rs.Fields.Count<br>Response.Write &quot;&lt;TD&gt;&quot;<br>Response.Write rs.Fields(y - 1)<br>Response.Write &quot;&lt;/TD&gt;&quot; & vbCrLf<br>Next<br>Response.Write &quot;&lt;/TR&gt;&quot; & vbCrLf<br><br>'Move to the next record!<br>rs.MoveNext<br>Loop <br><br><br> <p>nick bulka<br><a href=mailto:nick@bulka.com>nick@bulka.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top