CoderZone.org
Pages: 1 « previous     next »
  Print  
Author Topic: SIte conversion from tables to CSS/divs  (Read 7114 times) Bookmark and Share
Max
Jr. Member
*****
Posts: 75



View Profile WWW
« on: Mar 13, 2011, 11:33:39 pm »

Some time ago I took ownership of a large site that was created using Frontpage (ack).

It's all done in tables, lots and lots of tables. And the person that did it never met a FONT tag he didn't like, so there are bajillions of font tags in every page.

I'm pondering doing a conversion to DIVs and CSS, but I have some concerns...

1) First and foremost, is it worth it? We're talking ~500 pages, many with embedded code samples. I'm not sure if there would any real gain to doing it. (??)

2) The current google page rank and presence is very good, and I don't want to bork that up.

3) I could write a conversion script to strip and replace the font tags, but converting the tables to divs has me stumped. I don't know how I'd go about that. If I pulled the pages into something like Dreamweaver, would it be able to do a conversion? (My guess is "no", but I'd spend the $$$ if it could.)

Or, should I skip the whole mess and spend my time on something else?
Logged
bizzar
Newbie
*
Posts: 19



View Profile
« Reply #1 on: Mar 14, 2011, 07:00:15 am »

It'd probably be easier just to create a css/div template, then scrape the content off the previous pages and merge that with the template. Or use a content management system, do the template, then import the content and try and configure it so the pages keep the same URLs they had before.
Logged
cuberat
Newbie
*
Posts: 40


View Profile
« Reply #2 on: Mar 14, 2011, 07:23:04 am »

I'd skip it.

Most people look at the page, read the information and move on.

As long as the pages display correctly - you might as well leave them.

When I Google for an answer, I never check how the page is coded - I read/copy what I need and then leave.

Logged
Max
Jr. Member
*****
Posts: 75



View Profile WWW
« Reply #3 on: Mar 14, 2011, 01:23:43 pm »

Half of me agrees, the other half wants to update it. For one thing the new pages would probably be a lot lighter and load faster. Having everything done in CSS would allow me to do some fancy stuff later on (highlighting, linking, etc) based on the div ids.

But just leaving them the way they are is awfully tempting too. It's not like I don't have other stuff to do.

I'd skip it.

Most people look at the page, read the information and move on.

As long as the pages display correctly - you might as well leave them.

When I Google for an answer, I never check how the page is coded - I read/copy what I need and then leave.
Logged
Max
Jr. Member
*****
Posts: 75



View Profile WWW
« Reply #4 on: Mar 14, 2011, 01:31:51 pm »

This is probably the easiest route (I definitely don't want to do them all by hand). The structure of the current pages make it hard to do anything automated though...I have access to the content directly, so I was considering several intermediate steps.

1) Strip all the font tags.
2) Strip away most of the table tags, leaving just the cells with the content.
3) Convert/replace the cells to divs.
4) Add styles to the text and code divs.

I dunno...it sounds straightforward, but probably isn't. I've found that trying to mimic tables with divs never seems to work well for me, or at all. If I had a standard "table-like" div template to use I could probably start from there but all in all replacing tables with divs hasn't ever gone well for me.

If someone can show me an example div structure that nicely mimics a two-column, multi-row table, I'll try and give it a whack.


It'd probably be easier just to create a css/div template, then scrape the content off the previous pages and merge that with the template. Or use a content management system, do the template, then import the content and try and configure it so the pages keep the same URLs they had before.
Logged
cuberat
Newbie
*
Posts: 40


View Profile
« Reply #5 on: Mar 15, 2011, 05:57:27 am »

Quote
I have access to the content directly, so I was considering several intermediate steps.

Does this mean the content is in a database or that you have a collection of static HTML files?

It all depends on the structure of the pages.  Is it fairly constant?  Can you post a representative sample?

If h tags were used properly, and the pages are fairly close to valid XHTML, stripping out all the font tags and inline style attributes may be enough.

Also - cleaning the code up in phases, may be worth considering - so at the end of the first phase you have clean pages with tables, and then you can return later and add more style, and finally, transition to divs if you have time.
Logged
bizzar
Newbie
*
Posts: 19



View Profile
« Reply #6 on: Mar 15, 2011, 06:30:39 am »

For me, I think tables are sometimes necessary evil, especially if you have data you need to display as a table. I honestly was stuck on tables for a while too, but the more I worked with CSS, the easier I found it to be. For example, I did http://www.bizzarmafia.com in all css with divs and it turn out great. But if I had a bunch of data to display via rows and columns, I would use a table. Otherwise I use css for layouts now.

Just noticed the bizzarmafia site is pending renewal, but should be back up shortly.

This is probably the easiest route (I definitely don't want to do them all by hand). The structure of the current pages make it hard to do anything automated though...I have access to the content directly, so I was considering several intermediate steps.

1) Strip all the font tags.
2) Strip away most of the table tags, leaving just the cells with the content.
3) Convert/replace the cells to divs.
4) Add styles to the text and code divs.

I dunno...it sounds straightforward, but probably isn't. I've found that trying to mimic tables with divs never seems to work well for me, or at all. If I had a standard "table-like" div template to use I could probably start from there but all in all replacing tables with divs hasn't ever gone well for me.

If someone can show me an example div structure that nicely mimics a two-column, multi-row table, I'll try and give it a whack.


It'd probably be easier just to create a css/div template, then scrape the content off the previous pages and merge that with the template. Or use a content management system, do the template, then import the content and try and configure it so the pages keep the same URLs they had before.
Logged
Max
Jr. Member
*****
Posts: 75



View Profile WWW
« Reply #7 on: Mar 15, 2011, 07:15:47 am »

The pages are all static HTML pages that almost never change. They pull in a php header and footer, but the page content itself only changes if a typo is found and fixed.

I don't really want to put the pages into a database. The server cranks out millions of pages per month with a very low load, mostly because it's serving up static pages (with a few DB calls to load ad banners). I suspect if I started drawing them all from a DB the load would go up considerably.

Quote
I have access to the content directly, so I was considering several intermediate steps.

Does this mean the content is in a database or that you have a collection of static HTML files?

It all depends on the structure of the pages.  Is it fairly constant?  Can you post a representative sample?

If h tags were used properly, and the pages are fairly close to valid XHTML, stripping out all the font tags and inline style attributes may be enough.

Also - cleaning the code up in phases, may be worth considering - so at the end of the first phase you have clean pages with tables, and then you can return later and add more style, and finally, transition to divs if you have time.

Logged
Max
Jr. Member
*****
Posts: 75



View Profile WWW
« Reply #8 on: Mar 15, 2011, 07:19:20 am »

The data is in rows and columns, but nothing terribly complex. It could be done in CSS/divs if I had some code that mimicked the cell/row structure decently. I always seem to have issues stacking rows of divs or spans and it frustrates me to no end, lol.

For me, I think tables are sometimes necessary evil, especially if you have data you need to display as a table. I honestly was stuck on tables for a while too, but the more I worked with CSS, the easier I found it to be. For example, I did http://www.bizzarmafia.com in all css with divs and it turn out great. But if I had a bunch of data to display via rows and columns, I would use a table. Otherwise I use css for layouts now.
Logged
Tags:
Pages: 1
  Print  
 
Jump to: