PDA

Click to See Complete Forum and Search --> : Dynamic HTML tables


Skeen
Sep 14th, 2000, 04:14 AM
Can anyone tell me how to create a dynamic html table that will automatically size itself to the number of records/rows requested in an SQL querry?

Cheers 'n' beers.

Ianpbaker
Sep 14th, 2000, 05:36 AM
Hi skeen

Are you trying to this using ASP or vbscript?

Skeen
Sep 14th, 2000, 07:08 AM
Hi Ian

I'm using asp's and VBscript as the scripting language.
I can use sql and am getting fairly profficient at VBscript, but I've never really used HTML other than knocking a quick page together, so yes asp's and yep VBscript,

Nice 1

Skeen

Ianpbaker
Sep 14th, 2000, 07:15 AM
Hi skeen

The way do create a table using a database in ASP is in fact quite easy. All you need to so is open your recordset and do the following

<TABLE>
<%
While Not Recordset.Eof
%>
<TR>
<TD>
<% = Recordset("Myfield1") %>
</TD>
<TD>
<% = Recordset("Myfield1") %>
</TD>
<TD>
<% = Recordset("Myfield2") %>
</TD>
<TD>
<% = Recordset("Myfield3") %>
</TD>
</TR>
<%
Recordset.MoveNext
Next
%>
</TABLE>

You can mix and match your recordset around to get your desired affect.

The best thing I can suggest to you when making asp pages that are heavily made froma database is to design your pahe first as a standard HTML page, then convert it to an ASP page and subsitute the data into code to retrive it.

Hope this helps

Ian

Skeen
Sep 14th, 2000, 09:37 AM
Nice1 Ian - worked a treat.
Thanx 4 the help, believe me I need it!

Thanx again

Skeen.