Solved

HTML Table Problem w/ Microsoft Excel Imports

Posted on 2004-08-24
3
206 Views
Last Modified: 2012-05-05
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
Comment
Question by:shanepresley
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
flow79 earned 50 total points
Comment Utility
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
 
LVL 1

Author Comment

by:shanepresley
Comment Utility
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
 
LVL 13

Expert Comment

by:flow79
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now