Print Page | Close Window

HTML Tables in ASP

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5223
Printed Date: 30 March 2026 at 7:46pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: HTML Tables in ASP
Posted By: Misty
Subject: HTML Tables in ASP
Date Posted: 23 August 2003 at 11:47am
Flamewave helped me to solve my problem with displaying pictues from a database earlier this month. You can find the post at http://forums.webwiz.net/forum_posts.asp?TID=4763&PN=5 - http://forums.webwiz.net/forum_posts.asp?TID=4763&PN=5 .

However, I need help with something else now. Please take a look at http://www.hotelfloors.com/specials2.asp - http://www.hotelfloors.com/specials2.asp . I am unhappy with the way the tables are being displayed. I wanted the pictures of the specials to show up right beside the buttons. I cannot seem to get the tables to display the way I want them to. I was able to display three tables on the same line on one of my ASP pages. For some reason, I cannot show two tables on the same line on this page. Dreamweaver won't even let me move the table to my desired location on the page.

Please look at the html source of the page. I put the following code:   <td width="4"></td>
          <td bgcolor=white width="10">
between the two tables. But it didn't work.

Please let me know how I can fix this problem.

 




Replies:
Posted By: Bliss
Date Posted: 23 August 2003 at 5:17pm
Use colspan and rowspan instead of lots of empty tables. Tables that are empty do not follow the width attribute so you have to put &nbsp; in them.

-------------
Hehehe...


Posted By: b_bonnett
Date Posted: 23 August 2003 at 5:54pm

A hint for you: Resize the images in a imaging program, NOT the HTML! As it is, the images take ages to load, but if you resized them in an imaging program, the file size would be significantly less and load a helluva lot quicker.

Blair



-------------
Webmaster, http://www.planegallery.net/ - The Plane Gallery
Greetings From Christchurch


Posted By: Misty
Date Posted: 23 August 2003 at 7:18pm

I tried to make some changes. But it is still not working. Take another look at http://www.hotelfloors.com/specials2.asp - http://www.hotelfloors.com/specials2.asp . I cannot resize the images. The images are displayed from a database. Here's the code for my images: <td><a href="ViewSpecial.asp?qryID=<%=rs("SpecialsID")%>"><img src=../images/<%= rs("ImageName") %> width="144" height="144" border="0" alt=<%= rs("SpecialsName")%>></a></td>

I have to loop through the records to display all pictures. I wonder if I am having problems due to a lot of ASP Code.



Posted By: b_bonnett
Date Posted: 24 August 2003 at 12:10am

I don't see any reason in that piece of code why you cannot resize the images; they are not displayed from a database, the name of the image is stored in the database and the image is displayed from that. Personally, I would put a 144 x 144 copy of each image in a 'thumbnail' folder, then change the path from 'images' to 'thumbnail' in the code you gave. That way, you have a smaller, quicker loading image, and, if you need it, you have the full-size version. Believe me, people are far more likely to leave your site if the images take forever to load.

Blair



-------------
Webmaster, http://www.planegallery.net/ - The Plane Gallery
Greetings From Christchurch


Posted By: Bunce
Date Posted: 24 August 2003 at 1:52am

Misty,

Just to clear something up... If you change the image dimensions in your <img .. width="x" y="x">, you're not actually changing the physical filesize of the image.

All you are doing is 'squeezing' the existing image into the dimensions you specify... therefore it will not be any quicker to load.

As Blair suggested you should resize and resample your images using an imaging program.

Cheers,
Andrew



-------------
There have been many, many posts made throughout the world...
This was one of them.


Posted By: vshriniwasan
Date Posted: 24 August 2003 at 12:50pm
Can you show the whole source for the page. Copy and past it. That way we can see it clearly...


Posted By: Misty
Date Posted: 24 August 2003 at 1:49pm

Please take a look at http://www.signaturecarpets.com/runninglines.php?type=Cut+Pile - http://www.signaturecarpets.com/runninglines.php?type=Cut+Pile . This is how I would like for the pictures to be displayed on my web page at  http://www.hotelfloors.com/specials2.asp - http://www.hotelfloors.com/specials2.asp . My images are stored in a separate folder called "images". I would like to keep my images at width=144 and height=144.

I'll show some code below. I am not going to include everything.

1st table on the web page:

<table width="680" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="13" height="13">&nbsp;</td>
    <td width="504">&nbsp;</td>
    <td width="163">&nbsp;</td>
  </tr>
  <tr>
     <td height="108"></td>
 
    <td valign="top"><img src="NSLogo.gif" width="447" height="108"></td>
    <td></td>
  </tr>
  <tr>
    <td height="4"></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>

Second table on the web page (this table contains the buttons):
 
 
<table width="154" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="8" height="73"></td>
    <td width="125"></td>
    <td width="19"></td>
    <td width="2"></td>
  </tr>
  <tr>
    <td height="38">&nbsp;</td>
    <td valign="top"><a href="AboutUs.htm"><img src="AboutUs.gif" width="83" height="16" border="0"></a></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="38">&nbsp;</td>
    <td valign="top"><a href="Installations.htm"><img src="Installations.gif" width="104" height="16" border="0"></a></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="38">&nbsp;</td>
    <td valign="top"><a href="Specials.asp"><img src="Specials.gif" width="73" height="19" border="0"></a></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="38">&nbsp;</td>
    <td valign="top"><a href="BrowseProducts.asp"><img src="Products.gif" width="77" height="16" border="0"></a></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="38">&nbsp;</td>
    <td valign="top"><a href="ContactUs.htm"><img src="ContactUs.gif" width="97" height="16" border="0"></a></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="38">&nbsp;</td>
    <td valign="top"><a href="index.asp"><img src="Home.gif" width="52" height="16" border="0"></a></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>

Third Table (this is where I am having the problem):

         <td width="4"></td>
          <td bgcolor=white width="10">
<table border="0" cellspacing="0" cellpadding="0" width="85%">
<tr>
    <td height="45" valign="top"><div align="center"><font color="#000000" size="5" face="Arial, Helvetica, sans-serif"><strong>Specials</strong></font></div></td>
  </tr>

<%
Do While Not rs.EOF
  NumRecords = NumRecords + 1
  rs.MoveNext
  
Loop
rs.MoveFirst
Do While NOT rs.EOF %>
  <tr>
<% 
For i=1 to NUM_COLUMNS
  If rs.EOF Then
   EndOfRS = 1
   Exit For
  End If

    %><td><a href="ViewSpecial.asp?qryID=<%=rs("SpecialsID")%>"><img src=../images/<%= rs("ImageName") %> width="144" height="144" border="0" alt=<%= rs("SpecialsName")%>></a></td>

<% If rs.EOF Then
   EndOfRS = 1
   Exit For
 End If
 rs.MoveNext
  Next
  If EndOfRS = 0 Then
    rs.Move -NUM_COLUMNS
 If rs.BOF = True Then
   rs.MoveFirst
 End If
  End If
  If EndOfRS = 1 Then
    rs.MoveFirst
    Temp1 = InStr((NumRecords / NUM_COLUMNS), ".")
 Temp2 = Left((NumRecords / NUM_COLUMNS), Temp1-1)
 Temp3 = Temp2 * NUM_COLUMNS
    rs.Move Temp3
  End If
%>
  </tr>
  <tr>
<%
   For i=1 to NUM_COLUMNS
  If rs.EOF Then Exit For

 %><td><b><%= rs("SpecialsName") %></b><p><p><p></td>
 <%rs.MoveNext
 If rs.EOF Then Exit For
  Next
%>
  </tr>
<% Loop %>
</center></table>

I see no need to include the last table which has the links at the bottom of the web page. I don't believe that the code for the last table affects the way my pictures are being displayed.

 



Posted By: God_Struth
Date Posted: 24 August 2003 at 3:47pm
Couple of things you can do.

1- Try specifying the size you wish the table cells to be. (Your using % for the table, use it for the cells also.)

2- Don't use Dreamweaver for anything other than code views of your pages, it has a habit of putting gumf like this in:
<tr>
<td><b>Blue Carpet</b><p><p><p></td>
<td><b>Unknown</b><p><p><p></td>

</tr>


(Thats from a view source on your site.)


You also need to specify column span if you want the pics further up the page.


Ps.

Please take note of what has been said previously about the size of your pictures, I am on broadband in the UK and that page took so long to load I just had to see what was causing it. For those four pics to take so long is a criminal offence (Or should be..)

You only need to show a thumbnail there, not a file size of 277,126 (blue) - 186,951 (Carpet) - 61,953 (unknown) - The file size of an image 144*144 should be little over 6kb instead of 277,126kb.

If you don't know how to do this you should seek advice before you go any further. If your really stuck PM me and I'll step you through it should you need to.


Posted By: Misty
Date Posted: 25 August 2003 at 1:00pm

Unfortunately, I am unable to figure out how to work with the tables. I resized the pictures in Fireworks. But I could only resize them to a certain point. If I made them too small, I would end up with blurred pictures.

I really need help with displaying the pictures right beside the buttons on that web page.



Posted By: Misty
Date Posted: 25 August 2003 at 7:47pm
I finally got the pictures to be right beside the buttons.


Posted By: Flamewave
Date Posted: 25 August 2003 at 9:03pm

I updated my ASP gallery application so you can set a boolean at the top to disable/enable using pages/page numbers, so if you are instrested in using code that is much more effecient then the old code that you are using that I wrote, check it out. Plus this new one is much easier to custumize what each item will look like as it doesnt limit you to just a main picture/description and a title for each item.

Link: http://www.flameservers.com/asp_apps/gallery/gallery.asp - http://www.flameservers.com/asp_apps/gallery/gallery.asp



-------------
- Flamewave

They say the grass is greener on the other side, but if you really think about it, the grass is greener on both sides.


Posted By: b_bonnett
Date Posted: 25 August 2003 at 9:30pm

Originally posted by Misty Misty wrote:

Unfortunately, I am unable to figure out how to work with the tables. I resized the pictures in Fireworks. But I could only resize them to a certain point. If I made them too small, I would end up with blurred pictures.

There should be a Sharpen tool in there, use that to cure the blurriness.

Blair



-------------
Webmaster, http://www.planegallery.net/ - The Plane Gallery
Greetings From Christchurch



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net