ASP Tables

liunx

Guest
I am using tables to view information on my website retrieved from a database. There are a few things that I'm stuck on.<br />
<br />
(1) Can you have more than 1 table on the same page.<br />
<br />
(2) How do I set the size value of a picture stored on my database.<br />
<br />
(3) My table is currently verticle. How could I make it horizontal.<br />
<br />
I would be very greatful for some help and advice.<br />
<br />
Here is the code that is on my ASP page that retrieves the information from my database (Access):<br />
<br />
<br />
<%<br />
Dim myConn, myDB<br />
Dim rs<br />
Dim SQL<br />
Dim searchString<br />
<br />
searchString=Request.Form("pName")<br />
<br />
SQL = "SELECT * FROM tblProfile WHERE first_name= 'terry' ORDER BY Last_Name,First_Name;"<br />
<br />
Set myConn=Server.CreateObject("ADODB.Connection")<br />
<br />
myDB = "Driver={Microsoft Access Driver (*.mdb)};DBQ=e:\webareas\as921\RealCyprus\fixtures.mdb"<br />
<br />
myConn.Open myDB<br />
<br />
Set rs=myConn.Execute(SQL)<br />
<br />
Response.Write("<table border='1' cellpadding='5'><tr><td></td><br />
<td><B>First Name</B></td><br />
<td><B>Surname</B></td><br />
<td><B>Age</B></td><br />
<td><B>Height</B></td><br />
<td><B>Weight</B></td><br />
<td><B>Position</B></td><br />
<td><B>Foot</B></td><br />
<td><B>Games</B></td><br />
<td><B>Goals</B></td></tr>")<br />
<br />
<br />
while not rs.EOF%><br />
<br />
<tr><br />
<td><img src=http://www.htmlforums.com/archive/index.php/<%=rs("picture")%>></td><br />
<td><%=rs("first_name")%></td><br />
<td><%=rs("last_name")%></td><br />
<td><%=rs("age")%></td><br />
<td><%=rs("height")%></td><br />
<td><%=rs("weight")%></td><br />
<td><%=rs("position")%></td><br />
<td><%=rs("foot")%></td><br />
<td><%=rs("games")%></td><br />
<td><%=rs("goals")%></td><br />
</tr><br />
<br />
<br />
<% rs.MoveNext<br />
<br />
wend<br />
%><br />
</table><br />
<br />
</BODY><br />
</HTML><!--content-->1) you can have as many tables as you want. when the page it done rendering it is all html anyway so whatever you do it is not asp that is stopping you.<br />
<br />
2) you can't set the size of an image until it is shown on the page. you then have to use the width and heigth in an image tag.<br />
<br />
3) why wouold you want it horizontal? that would make you page go way to the right.<!--content-->sorry, I meant to say my table is horizontal and I wanted it to be verticle, because it is currently way to the right.<br />
<br />
Where would I put the height and width tags in the code I have used in my original post.<!--content-->set your width to your table to 100%. if it is still too wide then you have to many table cells to stop it.<br />
<br />
<td><img src=http://www.htmlforums.com/archive/index.php/<%=rs("picture")%> height="whatever" width="whatever"></td><br />
<br />
that is what you need but I do not know the image diminsions.<!--content-->Thanks mate, tried it and it worked.<!--content-->
 
Back
Top