Any way to auto format html files? (i.e. 1 tab before <tr>, 2 before <td>)

Discussion in 'Web Design and Development' started by johnbro23, Jun 28, 2006.

  1. johnbro23 macrumors 6502a

    Joined:
    Apr 12, 2004
    Location:
    Pittsburgh, PA
    #1
    I want a page that looks like this (obviously I'm dealing with much more complex examples)

    <table>
    <tr>
    <td>
    <table>
    <tr>
    <td>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>

    ...to look like this:

    <table>
    <tr>
    <td>
    <table>
    <tr>
    <td>
    </td>​
    </tr>​
    </table>
    </td>​
    </tr>​
    </table>

    I currently use TextWrangler as my main text editor. Is that feature built into that program? I have 60 or so complex table inside a table inside a table (I know, its not the smartest way to code!) so I'm looking for an automated system to make everything look pretty.
     
  2. radiantm3 macrumors 65816

    radiantm3

    Joined:
    Oct 16, 2005
    Location:
    San Jose, CA
    #2
    Not sure about text wrangler, but I know textmate does it. It's a very basic features so I'm guessing text wrangler (or maybe only bbedit) would have that feature.
     
  3. guifa macrumors 6502

    Joined:
    Sep 19, 2002
    Location:
    Auburn, AL
  4. mnkeybsness macrumors 68030

    mnkeybsness

    Joined:
    Jun 25, 2001
    Location:
    Moneyapolis, Minnesota
  5. cnunez1987 macrumors newbie

    Joined:
    Nov 23, 2009
    Location:
    Brooklyn, NY
    #5
    In case anyone was looking for the solution to do this, do a select all and then View > Balance or COMMAND+B to prettify it.
     

Share This Page