Hi,
I am trying to make my table on an asp page cleaner.
Right now, I have an html table on my page that draws information from my database. The customer can enter the following on the registration page:
Provider name: "drop down menu list" option named "provider1"
If name not listed, enter name: "text box" named "other"
Provider 2 name: "drop down menu list" option named "provider2"
If name not listed, enter name: "text box" named "other2"
The problem I am having is when the table shows up on the asp account page, there is akward spacing. For instance, if the user only finds his provider in line 1 but has to enter text for provider 2, there is a larger border between these. If they only enter one provider and leave the 2nd blank, the bottom of the table is extended down but nothing is there except the solid background color.
I am wondering if there is a better way to make a table that recognizes the information entered and resizes the table depending on the information entered.
Sorry if this is very confusing, I am having a heck of a time explaining this. If there is a way to show pictures on here, I'll gladly post a picture of my table if you can tell me how.
Thanks for any insight - Jerry
10 1954
Hello Jerry,
Could you post your code. That will help in getting you an answer.
Thanks,
CroCrew~
Here is my code. Please take note, the customer will either enter a text into the "program" or the "other" text boxes. If they enter 5 programs, the table looks great. If they enter less, there is extra space at the bottom and if they enter any "other" then the border lines are much fatter. Any ideas how to clean this up a bit? Thanks - <center><table width="30%" border="0" cellpadding="5" cellspacing="0">
-
<tr><table border="2" cellpadding="5" cellspacing="3" bordercolor="black" bgcolor="black">
-
<tr bgcolor="black">
-
<th colspan="2"><font color="white" face="perpetua titling mt"><b>Title</b></font></th>
-
<tr bgcolor="silver">
-
<th>Program</th>
-
<th>Points</th></tr>
-
<tr valign="top" bgcolor="white">
-
<td><%=objRS("Program1")%></td>
-
<td><%=objRS("Points1")%></td></tr>
-
<tr valign="top" bgcolor="white">
-
<td><%=objRS("Other1")%></td>
-
<td><%=objRS("Points1")%></td></tr>
-
<tr valign="top" bgcolor="white">
-
<td><%=objRS("Program2")%></td>
-
<td><%=objRS("Points2")%></td></tr>
-
<tr valign="top" bgcolor="white">
-
<td><%=objRS("Other2")%></td>
-
<td><%=objRS("Points2")%></td></tr>
-
<tr valign="top" bgcolor="white">
-
<td><%=objRS("Program3")%></td>
-
<td><%=objRS("Points3")%></td></tr>
-
<tr valign="top" bgcolor="white">
-
<td><%=objRS("Other3")%></td>
-
<td><%=objRS("Points3")%></td></tr>
-
<tr valign="top" bgcolor="white">
-
<td><%=objRS("Program4")%></td>
-
<td><%=objRS("Points4")%></td></tr>
-
<tr valign="top" bgcolor="white">
-
<td><%=objRS("Other4")%></td>
-
<td><%=objRS("Points4")%></td></tr>
-
<tr valign="top" bgcolor="white">
-
<td><%=objRS("Program5")%></td>
-
<td><%=objRS("Points5")%></td></tr>
-
<tr valign="top" bgcolor="white">
-
<td><%=objRS("Other5")%></td>
-
<td><%=objRS("Points5")%></td></tr>
-
</table></td>
Hello Jerrydigital,
It’s a bit confusing what your asking help for but I think this might help you out. It seems that you have built the table and are just plopping the recordset values in the cells. Thus; if programs 1, 2, 3, 4, 5 where entered then all the cells in each row would be filled. But let’s say if someone entered just programs 1, 2, 4, 5 then there would be a blank row between programs 2 and 4.
Without seeing all your code the only advice that I could give you is to check for a value in the recordset before building the row. Something like this for each row: -
<%
-
If (LEN(objRS("Program3")) > 0) Then
-
Response.Write("<tr valign='top' bgcolor='white'>")
-
Response.Write("<td>" & objRS("Program3") & "</td>")
-
Response.Write("<td>" & objRS("Points3") & "</td>")
-
Response.Write("</tr>")
-
End If
-
%>
-
Hope this helps,
CroCrew~
Thanks CroCrew,
I tried to implement your code but I got the following error: Microsoft VBScript compilation error '800a0408'
Invalid character
/accountpage.asp, line 106
If LEN(objRS("AProgram1")) > 0 Then
I am sure this didn't work because of my lack of knowledge but I have posted my entire code for this page below for your review.
The code you post above, is it from the page "accountpage.asp"?
Line 106 does not have the following code that the error is displaying:
If LEN(objRS("AProgram1")) > 0 Then
sorry for the confusion, the code above is for the table i have that is working but is uneven as i described above.
I get the error code when I substitute the following code with the code you provided: - <tr valign="top" bgcolor="white">
-
<td><%=objRS("AProgram1")%></td>
-
<td><%=objRS("APoints1")%></td></tr>
I enter this code in place of each row(the code directly above): - <%
-
If (LEN(objRS("AProgram1")) > 0) Then
-
Response.Write("<tr valign='top' bgcolor='white'>")
-
Response.Write("<td>" & objRS("AProgram1") & "</td>")
-
Response.Write("<td>" & objRS("APoints1") & "</td>")
-
Response.Write("</tr>")
-
End If
-
%>
The first thing I would have you do is to check the punctuation marks in your VBScript, particularly look out for apostrophes and commas that do not display correctly. The error is stating that your code contains an illegal character. It can happen when you copied the script, then paste into your code. For example, to 'Remark out a line we need the apostrophe, which is ASCII character 39; however if you paste from word you may get ASCII 96. I have done that before. So try looking very closely at the code you have to make sure that there are no funny apostrophes or quotes first. I would just retype the code and not copy and paste it just to make sure.
I will keep looking for more solutions.
Hope this helps,
CroCrew~
Hello jerrydigital,
Could you try adding his code right before where the error is reporting the run it again. -
Response.Write("Post This: [" & objRS("AProgram1") & "]")
-
Response.End
-
I would like to see what the value of the record is if you don’t mind. After you run it could you post what is being displayed between the brackets (post the brackets too so we can see if there is any white space before and after the value).
Thanks,
CroCrew~
CroCrew,
I repeated my substitution I mentioned in my last post, but I followed your advice and simply typed it out instead of copy and paste. And, it works perfectly. Thank you so much for your expertise. This makes my table so much more professional.
Jerry
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Tony Marston |
last post by:
Several months ago I started a thread with the title "What is/is not
considered to be good OO programming" which started a long and
interesting discussion.
I have condensed the arguments into a...
|
by: Mark Johnson |
last post by:
Oddly enough, I found it difficult, using Google, to find a list of
best-of sites based on the quality of their css packages.
So I'd ask. Does anyone know of particularly good sites which are in...
|
by: Neal |
last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog
entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A
quite good article.
|
by: Jonas Smithson |
last post by:
I'm going to say something now that may seem to completely contradict
a previous post of mine, in which I basically said that taking a "who
cares" attitude about certain browsers (because of their...
|
by: Matt Kruse |
last post by:
http://www.JavascriptToolbox.com/bestpractices/
I started writing this up as a guide for some people who were looking for
general tips on how to do things the 'right way' with Javascript. Their...
|
by: Dave |
last post by:
(My apologies for posting this on two forums. I have just found out the other
one was the incorrect location)
I am writing a VB.NET 2003 web application to operate on my company's
intranet. It...
|
by: ink |
last post by:
Hi all,
I am trying to pull some financial data off of an HTML web page so that I
can store it in a Database for Sorting and filtering.
I have been thinking about this for some time and trying...
|
by: James R. Davis |
last post by:
Yes, a newbie here.
Though I am making progress, slowly, I am also getting more and more
confused.
With ASP, when I wanted to do something as trivial as updating a visitor
counter, I...
|
by: Zhang Weiwu |
last post by:
I know the subject line is really bad. Here is the real question: we
have a web application that lists 1200 products. The web page present
only 12 products at once, if you wish to see the next 12...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |