• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 407
  • Last Modified:

Converting tables to divs

Is there an easy way to convert tables to divs?  I absolutely hate working with tables when developing websites.  Thanks!
1 Solution
Om PrakashCommented:
i don't think there is a tool which will convert tables to div.
you can refer to following link for DIV based layout
Mark BradyCommented:
Unfortunately I don't think there exists a tool for converting tables to divs. You need to give each div an id name or a class name so that makes it impracticable for a program to do it in most cases. You could use your keyboards "find and replace" function ( ctrl + f ) or ( ctrl + r ) depending on which opperating system you use. Replace or find and replace all instances of "<td>" with "<div id="">" without the quotes of course. Then do a replace for all instances of "</td>" with "</div>"
Then you would do a replace of "<tr>" with "" (blank cause we just want to delete them). And replace any other table tags with blanks as well.

You should be left with a bunch of <div id=""> and </div>. At least you only need to edit the first ones and give them id names. If you are going to style you page using CSS then each div must have a name or class name to identify it. Not the best method but that is all I can think of to help you out.

I myself have changed several older websites over to <div> and CSS just to bring them into the 2000's.
you can use regex search and replace for a part of the conversion , but - as the table and the div has other properties and structure - you will need to do it manually at most

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!

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