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.
Printable View
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.
Hi skeen
Are you trying to this using ASP or vbscript?
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
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
Nice1 Ian - worked a treat.
Thanx 4 the help, believe me I need it!
Thanx again
Skeen.