Log in

View Full Version : HTML table coding



gracexl
06-06-2011, 03:55 PM
Hi, I am using one of my existing website code to create a new website. The existing website utilize rowspan to place the body of the website content at the top of the code for search engine opitmization, but have 2 column as the first row. My new website only needs one column, so I use the colspan to merge two cells. Once I did that, the 2nd row got screwed up. Please see the link below. I need to get rid of the big space between the left navigation bar and the body of the content. Can anybody shed some lights on how to do that?

http://72.52.89.208/FitnessGrace/index.htm

Thanks!

traq
06-06-2011, 07:35 PM
Don't use tables for layout. You might look at this template (http://www.dynamicdrive.com/style/layouts/item/css-fixed-layout-21-fixed-fixed/) (you can adjust the widths of the columns however you desire).

djr33
06-06-2011, 07:38 PM
Tables are now strongly discouraged for layouts. They do work, but often they also have problems and they make the page render more slowly than using DIVs.

In this case you are also taking an existing (working) table layout and starting by making it very awkward code with colpspan attributes, etc. It will be difficult to control it precisely across all browsers.

That said, you can continue, but you will probably get more help if you replace at least some of that with divs, which are now standard.

[posted at the same time as traq]

gracexl
06-06-2011, 07:53 PM
Thanks for the response. The reason I used table is to use rowspan so that I can move the content of the website up to the top of the html code for search engine optimization. Is there any other way to accomplish that?

djr33
06-06-2011, 09:07 PM
You can position a div in a complicated way so that a certain part of the page is offset.

For example, place your content div at the beginning of the page, then make an absolutely positioned div that jumps to the top of the page for the navigation menu. This will cause the menu to appear first and the content second, but to a search engine it will be the opposite.

gracexl
06-06-2011, 09:58 PM
Hi Daniel,

Thanks for the response. I am not familiar with the coding you suggested. Do you have an example I can use?

Thanks!

coothead
06-06-2011, 10:29 PM
Hi there gracexl,

check out the attachment, for a reworking of your page, ;)


coothead

gracexl
06-06-2011, 10:54 PM
Thanks. I have two questions for the code you wrote:
1. will it cause the search engine to read the content of the website first before going through the navigation bar? My goal is to create an organic searchable website so my website can be placed at the top of google page. Any tips and insight would be very much appreciated.
2. I did try your code, and the layout looks the same as my current code which has a big gap between my navigation bar and content of my website. see the link below

http://screencast.com/t/tL2NTW9cuC

traq
06-07-2011, 01:00 AM
If you lay out your page in an organized way, and label things, then search engines won't have any problem determining where your content is and ranking it accordingly. Search engines aren't stupid. If your page has a good, logical outline, then you shouldn't have any problems, even though the content doesn't come until partway down the page.

djr33
06-07-2011, 04:17 AM
I agree with traq about that.