Converting tables to divs

Posted on 2011-05-08
Last Modified: 2012-05-11
Is there an easy way to convert tables to divs?  I absolutely hate working with tables when developing websites.  Thanks!
Question by:VBBRett
    LVL 22

    Expert Comment

    by:Om Prakash
    i don't think there is a tool which will convert tables to div.
    you can refer to following link for DIV based layout
    LVL 20

    Expert Comment

    by:Mark Brady
    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.
    LVL 5

    Accepted Solution

    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
    Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
    In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
    HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

    737 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

    21 Experts available now in Live!

    Get 1:1 Help Now