Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any tools for consolidating a whole bunch of style tags into classes? [closed]

Example:

Say for instance you had the following two tags some where in a legacy page you've been assigned to work on:

    <table style="padding:0px; margin:0px; border: 0px; width:100%;">

    <td style="width:100%; margin:0px; padding:0px;  border: 0px;">

Would there be a program that could make a list of these random style tags and re-arrange their contents perhaps ordering the css within the tags in alphabetical order:

    <table style="border: 0px; margin:0px; padding:0px; width:100%;">

    <td style="border: 0px; margin:0px; padding:0px; width:100%;">

Finally the tool would compare these these two style strings see that they are alike (when arranged alphabetically)...

    <table class="style1">

    <td class="style1">

...and assign a class both the tags and create a css entry:

    .style1 {
       border: 0px; 
       margin:0px; 
       padding:0px; 
       width:100%;
    }

...are there any existing tools/utilities/scripts for this?

like image 463
leeand00 Avatar asked Jan 11 '10 16:01

leeand00


1 Answers

Dreamweaver can do this

http://help.adobe.com/en_US/Dreamweaver/10.0_Using/WS8BC8A54F-60BC-40bd-A368-50A405C51350a.html

like image 100
Jitendra Vyas Avatar answered Sep 28 '22 02:09

Jitendra Vyas