Loading ...
Sorry, an error occurred while loading the content.
 

Color coding Cells

Expand Messages
  • Jeffery Scism
    I am attempting to build a clip for modifying a HTML table, adding BGCOLORs to cells. How do I get the Clip to run each command line in succession on an
    Message 1 of 2 , Oct 22, 2005
      I am attempting to build a clip for modifying a HTML table, adding
      BGCOLORs to cells.

      How do I get the Clip to run each command line in succession on an
      existing HTML document which contains Tables?

      Here are the command lines I want to have executed on all instances.


      ^!REPLACE '<td>8</td>' >> '<td align="center"
      bgcolor="#33FF00">8</td>' HTSA

      ^!REPLACE '<td>9</td>' >> '<td align="center"
      bgcolor="#FFFFFF">9</td>' HTSA

      ^!REPLACE '<td>10</td>' >> '<td align="center"
      bgcolor="#FF3300">10</td>' HTSA

      ^!REPLACE '<td>11</td>' >> '<td align="center"
      bgcolor="#FFCC00">11</td>' HTSA

      ^!REPLACE '<td>12</td>' >> '<td align="center"
      bgcolor="#FFFF00">12</td>' HTSA

      ^!REPLACE '<td>13</td>' >> '<td align="center"
      bgcolor="#33CC33">13</td>' HTSA

      ^!REPLACE '<td>14</td>' >> '<td align="center"
      bgcolor="#FF0033">14</td>' HTSA

      ^!REPLACE '<td>15</td>' >> '<td align="center"
      bgcolor="#FF9933">15</td>' HTSA

      ^!REPLACE '<td>16</td>' >> '<td align="center"
      bgcolor="#FFFF33">16</td>' HTSA

      ^!REPLACE '<td>17</td>' >> '<td align="center"
      bgcolor="#66FF66">17</td>' HTSA

      ^!REPLACE '<td>18</td>' >> '<td align="center"
      bgcolor="#FFFF99">18</td>' HTSA

      ^!REPLACE '<td>19</td>' >> '<td align="center"
      bgcolor="#66FFCC">19</td>' HTSA

      ^!REPLACE '<td>20</td>' >> '<td align="center"
      bgcolor="#FF6666">20</td>' HTSA

      ^!REPLACE '<td>21</td>' >> '<td align="center"
      bgcolor="#33CC99">21</td>' HTSA

      ^!REPLACE '<td>22</td>' >> '<td align="center"
      bgcolor="#FF99CC">22</td>' HTSA

      ^!REPLACE '<td>23</td>' >> '<td align="center"
      bgcolor="#33FFFF">23</td>' HTSA

      ^!REPLACE '<td>24</td>' >> '<td align="center"
      bgcolor="#FF6699">24</td>' HTSA

      ^!REPLACE '<td>25</td>' >> '<td align="center"
      bgcolor="#FFFF99">25</td>' HTSA

      ^!REPLACE '<td>26</td>' >> '<td align="center"
      bgcolor="#33FF00">26</td>' HTSA

      ^!REPLACE '<td>27</td>' >> '<td align="center"
      bgcolor="#66FFCC">27</td>' HTSA

      ^!REPLACE '<td>28</td>' >> '<td align="center"
      bgcolor="#FF3300">28</td>' HTSA

      ^!REPLACE '<td>29</td>' >> '<td align="center"
      bgcolor="#FFCC00">29</td>' HTSA

      ^!REPLACE '<td>30</td>' >> '<td align="center"
      bgcolor="#FFFF00">30</td>' HTSA

      ^!REPLACE '<td>31</td>' >> '<td align="center"
      bgcolor="#33CC33">31</td>' HTSA

      ^!REPLACE '<td>32</td>' >> '<td align="center"
      bgcolor="#FF0033">32</td>' HTSA

      ^!REPLACE '<td>33</td>' >> '<td align="center"
      bgcolor="#FF9933">33</td>' HTSA

      ^!REPLACE '<td>34</td>' >> '<td align="center"
      bgcolor="#FFFF33">34</td>' HTSA

      ^!REPLACE '<td>35</td>' >> '<td align="center"
      bgcolor="#33FFFF">35</td>' HTSA

      ^!REPLACE '<td>36</td>' >> '<td align="center"
      bgcolor="#FF6699">36</td>' HTSA

      --
      ~~

      Jeffery G. Scism, IBSSG


      (\o/)
      ./_\ http://groups.yahoo.com/group/Genie-Angels/
    • Marcelo de Castro Bastos
      ... Well, from what I m seeing, you may be having a number of different problems: Are you trying to run this only inside a selection? If not, the H parameter
      Message 2 of 2 , Oct 22, 2005
        On 22/10/2005 16:19, Jeffery Scism invited the wrath of the gods by saying:

        >I am attempting to build a clip for modifying a HTML table, adding
        >BGCOLORs to cells.
        >
        >How do I get the Clip to run each command line in succession on an
        >existing HTML document which contains Tables?
        >
        >Here are the command lines I want to have executed on all instances.
        >
        >
        >
        Well, from what I'm seeing, you may be having a number of different
        problems:
        Are you trying to run this only inside a selection? If not, the "H"
        parameter might be confusing the issue.
        - a. If you ARE trying to run inside a selection, you probably need to
        "reset" the cursor position to the top of the file between each search.
        If you don't, it will only search from the "current" (meaning, "last
        found") position to the end.
        - b. If you are NOT trying to run inside a selection, replace the "H"
        parameter with an "W" (for "whole document" search and replace). This
        has the bonus of not needing to "reset" cursor position -- it will
        always go top-to-bottom, regardless.

        Whatever the result, might I suggest you try a slightly different
        replacing string? For instance, instead of

        >^!REPLACE '<td>8</td>' >> '<td align="center"
        >bgcolor="#33FF00">8</td>' HTSA
        >
        >
        >

        You might try

        ^!REPLACE '<td>8</td>' >> '<td class="td-8">8</td>' HTSA

        and then place an style like this on your stylesheet:

        td.td-8 {background-color:#33ff00;
        text-align:center;}

        That way, you get a smaller, cleaner HTML page AND can experiment with formatting in an easier way -- for instance, to change the color on the cells, you will only have to edit one place: the stylesheet.

        Also, this allows to do the ENTIRE replacing sequence with just ONE command (using regular expressions):

        ^!REPLACE '<td>{\d+}</td>' >> '<td class="td-\1">\1</td>' HTSRA

        Marcelo Bastos


        -=-=-
        ... Nanosecond: Mork's stunt man.
        * TagZilla 0.057
      Your message has been successfully submitted and would be delivered to recipients shortly.