[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

HTML Table Problem w/ Microsoft Excel Imports

Hello there,

I run a website for a JR Hockey league.  I wrote it mostly by hand, no
HTML editor.  So the code may be sloppy :-)

It uses a number of include file.  Basically an shtml file pulls in:

-Header file
-Navigation bar
-Main data
-Footer file

The "main data" for the site comes from Microsoft Excel, using the
Publish as Webpage feature.

The pages use a number of tables.  I'm having a problem with the
alignment of one of the cells.   If you look at
http://www.empirehockey.com/teams.shtml you can see how I want it to
look.  Notice how the navigation bar is aligned at the top of the page
(and the top of a table row)??

Now look at what happens when the Microsoft Excel data is long.
http://www.empirehockey.com/schedule.shtml  The navigation bar gets
pushed to the bottom.

I've used td valign=top for that cell but it doesn't do any good.  I
also can't find any glaring table errors, but obviously I have one
somewhere.

One note is that I can't control the format of what Microsoft Excel
exports.  It includes more tables, and even HTML and BODY tags.  I
know that's sloppy but it seems to work, and I can't change that part.

Any idea what I can do in my code to force my navigation bar to always
be top aligned?

Thanks!!!!!!
Shane
0
shanepresley
Asked:
shanepresley
  • 2
1 Solution
 
flow79Commented:
first, I just want to say (other than the menu alignment) - Great looking site!  I really like it.  

However, I think you already know what your problem is.  and that is the multiple heads and bodys in your html.  They will throw off the layout to an extreme degree.

I hate to say this, but it may be time to learn ASP or PHP (and how to use a database) - that way you store your data in the DB, not excel.  (or you can write ASP functions to export the excel data in a properly coded manner).

your code is over 5500 lines long (way too much to try to sift through).  I know its a huge pain, but I would say your best bet (other than correcting it, line by line) would be to learn ASP and DBs.

good tutorials can be found at:
http://www.w3schools.com/asp/default.asp
http://www.spoono.com/asp/
http://www.asptutorial.info/
http://www.aspin.com/
http://www.aspfree.com/

or ask questions in the ASP TA here on EE.

Good luck!
0
 
shanepresleyAuthor Commented:
Yea, I did a little more digging, and found the problem.  You were on the right track.  It's not specifically the html or body tags.  It was that Excel was adding a <style> tag, where it defined vertical-align:bottom;

That caused my cells to be bottom aligned.  I was able to change that behavior in Excel, by just formatting the cells to be top aligned.

Yes, I agree, it's messy.  I think you're right, ASP is the way to go.  But at the moment there are so many calculations done in Excel by our stats people, that I don't want to rewrite that in ASP.   So I'm glad I was able to solve this problem for now.  But in the future I'll try to learn ASP.  Thanks for your help!
0
 
flow79Commented:
Just for your future reading, ASP does have a technique to import data directly from Excel.

http://www.devasp.com/search/display/category826.html

http://www.greggriffiths.org/webdev/both/excel/

http://www.devasp.com/search/res/r23914.html

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now