SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Addict
    Join Date
    Dec 2009
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how do I format a messy html code ?

    Here is a messy code ...

    http://jsfiddle.net/terminator/jGqG5/

    I find select box and options are in single line. ...no proper indention.

    Is there any tool which could properly indent and beautify my html code ?

    Looking for a lightweight tool. I'll be dealing with mostly HTML code.

  2. #2
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    HTML Tidy not only properly indent and beautify your HTML codes, it is also a tool for checking and cleaning up HTML source files as well.

    http://infohound.net/tidy/

  3. #3
    SitePoint Addict
    Join Date
    Dec 2009
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Excellent. This works. you are very much helpful.

  4. #4
    SitePoint Addict
    Join Date
    Dec 2009
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tom8 View Post
    HTML Tidy not only properly indent and beautify your HTML codes, it is also a tool for checking and cleaning up HTML source files as well.

    http://infohound.net/tidy/
    I dont want any extra code by html tidy. What. Settings i need to check?

  5. #5
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,836
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    @windowsxp

    Take a look at this Firefox Addon - the user interface is very intuitive and simple:

    http://users.skynet.be/mgueury/mozilla/

    This window pops up when the bottom right hand icon is clicked:
    screen-dump.jpg


    HTML Code:
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
      <head>
        <title>ample code</title>
        <style type='text/css'>
    /*<![CDATA[*/
        .bg1 {background-color:#f99} .bg2 {background-color:#9f9} .bg3 {background-color:#99f}
        body {background-color:#eee}
        table {width:88%; margin:1em auto; background-color:#fff}
        /*]]>*/
        </style>
        <style type="text/css">
    /*<![CDATA[*/
        div.c2 {WIDTH: 100%; DISPLAY: none}
        div.c1 {DISPLAY: block}
        /*]]>*/
        </style>
      </head>
      <body>
        <table border="3" cellspacing="0" cellpadding="0">
          <tbody>
            <tr>
              <td width="12%">
                Fund Source
              </td>
              <td width="28%">
                <select id="fundSourceId" class="text_box" name="fundRelease.fundSourceId">
                  <option selected="selected" value="">
                    All
                  </option>
                  <option value="1">
                    National
                  </option>
                  <option value="2">
                    Revolving
                  </option>
                  <option value="34">
                    Perf
                  </option>
                  <option value="42">
                    FundSource18956
                  </option>
                  <option value="43">
                    FundSource50839
                  </option>
                  <option value="44">
                    FundSource96841
                  </option>
                  <option value="45">
                    FundSource2871
                  </option>
                  <option value="47">
                    Treasury Funds
                  </option>
                  <option value="48">
                    livelihood Development
                  </option>
                  <option value="49">
                    livelihood Development english6
                  </option>
                  <option value="50">
                    uu8uhuhuhuhu
                  </option>
                  <option value="51">
                    livelihood Development english6
                  </option>
                  <option value="52">
                    livelihood Development english6
                  </option>
                  <option value="53">
                    Reg Fund1
                  </option>
                  <option value="54">
                    RegFund2
                  </option>
                  <option value="55">
                    ABC
                  </option>
                  <option value="56">
                    Test_2nd_April_National
                  </option>
                  <option value="57">
                    Test_2nd_April_Revolving
                  </option>
                </select>
              </td>
              <td width="5%">
                &nbsp;
              </td>
              <td width="12%">
                Start Date*
              </td>
              <td width="43%">
                <input id="startDate" class="text_box_medium hasDatepicker" readonly="readonly" maxlength="50" type="text" name="fundRelease.startDate" jquery1334307120124="148" />
              </td>
            </tr>
            <tr>
              <td>
                &nbsp;
              </td>
            </tr>
            <tr>
              <td width="12%">
                District*
              </td>
              <td>
                <select id="selectedDistrict" class="text_box" onchange="checkBoxFunc();" name="fundRelease.distId" jquery1334307120124="151">
                  <option value="">
                    Select
                  </option>
                  <option value="25">
                    Dist1
                  </option>
                  <option value="26">
                    Dist2
                  </option>
                  <option value="27">
                    Dist3
                  </option>
                </select>
              </td>
              <td>
                <div class="c1" id="div_CheckBox">
                  <table border="0" cellspacing="0" cellpadding="0" width="100%">
                    <tbody>
                      <tr>
                        <td>
                          Divisional Secretariat
                        </td>
                        <td>
                          <input id="checkbox1" align="left" type="checkbox" name="checkbox1" jquery1334307120124="150" />
                        </td>
                      </tr>
                    </tbody>
                  </table>
                </div>
              </td>
              <td width="12%">
                End Date*
              </td>
              <td width="43%">
                <input id="endDate" class="text_box_medium hasDatepicker" readonly="readonly" maxlength="50" type="text" name="fundRelease.endDate" jquery1334307120124="149" />
              </td>
            </tr>
            <tr>
              <td>
                &nbsp;
              </td>
            </tr>
            <tr>
              <td width="12%">
                <div class="div_division c2" jquery1334307120124="154">
                  Division*
                </div>
              </td>
              <td width="28%">
                <div class="div_division c2" jquery1334307120124="155">
                  <select id="selectedDivision" class="text_box" name="fundRelease.divId">
                    <option selected="selected" value="-1">
                      --- Select ---
                    </option>
                    <option selected="selected" value="div1">
                      DIV1
                    </option>
                    <option selected="selected" value="div2">
                      DIV2
                    </option>
                    <option selected="selected" value="div3">
                      DIV3
                    </option>
                  </select>
                </div>
              </td>
            </tr>
            <tr>
              <td colspan="5">
                <input id="submit_1682155201" class="submit_btn_base" title="Search" value="Search" type="submit" jquery1334307120124="152" />
              </td>
            </tr>
            <tr>
              <td>
                4.6          </td>
              <td>
                4.1142857142857          </td>
              <td>
                322          </td>
              <td>
                34          </td>
              <td>
                34          </td>
            </tr>
            <tr>
              <td valign="top" colspan="5">
                <div id="searchFundRelease" jquery1334307120124="153">
                  &nbsp;
                </div>
              </td>
            </tr>
          </tbody>
        </table>
      </body>
    </html>
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Patche on earning Member of the Month for July 2014

  6. #6
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by windowsxp View Post
    I dont want any extra code by html tidy. What. Settings i need to check?
    Click on Advanced (underneath the Tidy! submit button) and uncheck those settings that you do not want.


    Quote Originally Posted by John_Betong View Post
    @windowsxp

    Take a look at this Firefox Addon - the user interface is very intuitive and simple:

    http://users.skynet.be/mgueury/mozilla/
    I installed the addon and it works but the original source code is not shown. I did not play with long enough to find out all the options since I uninstalled it after seeing that it somehow changed a setting on my FileZilla. So be warned before installing.

  7. #7
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,836
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    @tom8,

    http://users.skynet.be/mgueury/mozilla/

    I installed the addon and it works but the original source code is not shown. I did not play with long enough to find out all the options since I uninst
    Try it again when you have more time to find the Filezilla conflict. I have been using the validator for a couple of years and als use FileZilla and have experienced no problems or conflicts.

    The following link is to the forum where you could maybe ask for help:

    http://htmlpedia.org/phpBB/
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Patche on earning Member of the Month for July 2014


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •