JS/CS3 Move content to previous table cell

I try to create a script that should find and cut a certain content of the cell and paste it to previous cell. For example $12,333.  The $ sign should be in the previous cell while the number should retain to its location. I am new in scripting and my script don't work that way. Please help.
var myDoc =  app.activeDocument;
app.findTextPreferences = app.changeTextPreferences = null;
app.findTextPreferences.findWhat = '$';
var myFound = myDoc.findText();
for (i = myFound.length-1; i >= 0; i--)
myFound[i].insertionPoints[0].select();
myFound[i].insertionPoints[0].contents = "$";

Avoid copying/cutting and pasting if you can. In your script it looks as if you don't need it. In a table, some text's parent is a cell. Cells have a parentColumn and a parentRow.
for (i = myFound.length-1; i >= 0; i--)
    myCell = myFound[i].parent;
    myFound[i].characters[0].remove ();
    myCell.parentRow.cells [myCell.parentColumn.index-1].contents = "$";
Peter

Similar Messages

  • Want Flash movie to scale with table cell. NOT WORKING!

    Greetings;
    I have authored a Flash movie and it is working fine. When I
    use the html page output by Flash it scales fine but when I cut and
    paste this code into a table cell the movie will not scale (in
    Firefox) and not showup at all in IE 7.
    Help appreciated. Here is the html page output by Flash:
    http://www.howardbakerphotography.com/gallery/bakerGallery.html
    (Scaling fine)
    Here is the content placed inside a simple table cell:
    http://www.howardbakerphotography.com/gallery/index3.php
    (Only shows up small not scaling)
    Help appreciated.
    Rip

    Found the solution myself! It appears the problem was in the
    document type I was declaring:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    *The above was preventing my Flash from scaling when placed
    in a table cell. When I changed it to:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN" >
    It worked fine.
    I'd be curious to know a little more about this problem if
    anyone else has some insight ...
    Is this document type I've gone to now an older one and going
    to eventually go away?
    Rip

  • Problem with table cells

    Hi,
    actually i wanted to know that is there any way
    so that i can show contents of a table cell in two pages, i.e, half the cell is in one page and other half of the cell on another page
    as my cell content is very large it do not fit in one page.
    I'm using InDesign CS3
    Thanks

    Hi,
    As I've already written in another post, that depends on, but I'm not sure that using a table structure is always the best way! 

  • Copy text in table cells  Framemaker 10

    I want to copy the content of several table cells in an other table of the same document. How can I do this so that the text is copied in several cells again and not all the content in only one cell?
    Margot

    Normally, just make sure you select the same array of cells in both source and destination table. If they don't match, geometrically, it may not work. This might happen, for example, if you have a straddle in one but not the other.
    If the tables need to have identical content for some cells going forward, consider having the clone table's cells populate the shared cells with cross-references, by paragraph text, to the master table. Then if the master table changes, so does the clone.

  • Separate or move character in table cell

    I have table with "$" value. I want to separate the $ in cel befor it. is there a script that can move this "$" in the previous cell.

    Hi Kent,
    For the Table cell editor only basic UI controls can be added. It doesn't supprt container controls like scroll container or transparent container. So adding the scroll container n then inserting a text view element into it is not possible in case of table cells.
    One of the solution can be....just add a text view control as the cell editor n sets the following properties :
    For text view:  Set 'Wrapping' to true.
    For table column: Set 'Resizable' to true.
    Hope it serves your purpose.

  • Move cell contents forward/backwards by cell?

    Hello,
    Is there a way in InDesign to "shift" the contents of a table? Basically, I'm working on a calendar and the template by the designer was given to me and I now need to modify all the tables so dates are in the correct order, etc.
    I can only image this has to be a basic function in any application using tables, but you never know...?
    Thanks!
    Kristin.

    Hi Dave,<br /><br />1. Yep -- I didn't take the header row into account. Rodney, if you use the first version, it'll also shift the days-of-the-week at the top. Select that row and change it to a header. It's not necessary for your calendar, but that way the scripts can see where to start.<br /><br /><pre>var myTable = app.selection[0].parent;<br /><br />// Forward:<br /><br />firstBodyCell = myTable.headerRowCount*myTable.columns.length;<br /><br />for (i=myTable.cells.length-1; i > firstBodyCell; i--)<br /><br />{<br /><br />     myTable.cells[i].contents = myTable.cells[i-1].contents;<br /><br />}<br /><br />// Backward:<br /><br />for (i=firstBodyCell; i<myTable.cells.length-1; i++)<br /><br />{<br /><br />     myTable.cells[i].contents = myTable.cells[i+1].contents;<br /><br />}</pre>2. That's a tricky one. However, I don't believe it to be a problem, since the cells before and after numbered ones are empty.  The script does not try to 'loop around'. You will have to move the full month calender cells at the bottom right yourself, but you have to recreate these anyway.<br /><br />Obviously, you should not try to move backward if the first day falls on a Sunday (as in the February example on the site). In that case, either move forward 6 times, or insert an empty row above the days and run the backwards script. Similarly, if the last cell bottom right has a day number, insert a blank row below first.<br /><br />(I had a quick go at a JS where all you have to do is fill in the year and month, but that took a bit longer than I thought. It might be the most easiest way just to re-create the entire month. Dave?)

  • Space in table cell content

    Hi,
    I want to add some space before and after the table cell content. I am using setIntercellSpacing() method to achieve that and I could get the required functionality. But its adding space in the Table Header also which looks odd. Is there any way to set the spacing only for the cell and not for the table header.
    Let me know if anyone has solution for this.
    Thanks and Regards,
    R.Vishnu Varadhan.

    I find this behaviour of setIntercellSpacing() very annoying, too. Why the hell did the Swing developers implement it that way?
    Nevertheless, you can create the desired effect by writing a custom cell renderer, but that is if course more work than that single method call.

  • Autofit column width to table cell content in Pages

    Hello,
    Would anyone know how to autofit the column width of a table cell in Pages '09?
    I have searched Pages Help to no avail.
    Thank you very much in advance.

    There is a checkbox in the table inspector to auto-resize to fit content. Unfortunately, that only seems to work with rows, not columns.

  • Need content in table cell to scroll

    I Need content in table cell to scroll, so the window stays a constant height. Help.

    Google for 'scrollable DIV' or 'iframe'. Scrollable DIVs are better.

  • Fill table cells with color % depending on cell content

    Hi.
    I'm working on a document with a lot of tables filled with percentages. The tables are originally on a Word document and the table cells are tinted according to their content: a value of 20% on the cell corresponds to a tint of 20%. This is done automatically on the Word document through a conditional formatting option that applies a graded color scale. Is there any way to do this in InDesign? I tried placing the tables and tried all options, but the color is not imported. Perhaps a script or a GREP style?
    Thank you.

    Conditional formatting in Word is done via formula, but in Excel it is handled more "on the surface" and Excel's conditional formatting carries into InDesign nicely via Place or Paste. It could be worth considering moving those tables into Excel.
    InDesign doesn't do this kind of formatting as a native function, but it couldn't hurt to ask about possible scripted solutions in the Scripting Forum.

  • Pasting content into table cell deletes existing content. Why?

    Pasting content into table cell deletes existing content. Why?

    I'm not sure why you would expect something different. If you put something into a cell, then that is the contents of the cell. If you want to preserve the existing contents when pasting additional content, you don't want to paste into the cell, you want to paste into its contents.
    Select the cell, then click again to put the insertion point into the contents, then Paste.

  • SAP Portal development-Table Controls having link to table cell content

    Hello all,
    I am creating the SAP portal in which i am using Table controls to display the data. I want the function should be called whenever user clicks the table cell content. i.e. i want to create the function link to table cell.
    Please reply soon.
    Regards,
    Prashant

    Hi Prashant,
    You haven't mentioned if you are using Webdynpro or HTMLB JSPDynPages.
    If its the webdynpro, you can declare then and there itself that the content to the table column is a row my changing the property.
    If it is a HTMLB component TableVIew that you are trying to use, you can include a TableCellRenderer Class which renders the cells of the table at the runtime as links or buttons or whatever you want to put.
    So let me know, what exactly you are trying to use, then finding a solution will be more clear.
    regards,
    Sujana

  • Urgent! HTML table cell - Flash movie display browser dependent

    Hi all,
    I wonder if anyone has experienced the same problem i have
    (note, Windows XP, Dreamweaver 4).
    Consider the (rough) HTML code attached: A simple HTML table
    of one column and two rows is constructed to hold an image banner
    link and a Flash movie banner link in each cell consecutively.
    The Flash movie works normally when the HTML page is viewed
    in IE and Opera, until that is, it is placed inside a table cell.
    Inside the cell the flash movie seems to disappear, though i
    suspect it collapses to an image 1 pixel in height, as this can
    just about be seen using Opera.
    Is there something that I am missing? The code of course
    seems correct to me - perhaps there is a browser setting i am
    missing?
    Any help apprceiated - as i need to implement this code ..
    Daz

    Hi Alan,
    Dont think that was the problem (percentages used to scale to
    users browser?) ... though you did set me thinking!
    Was tired before, so only just remembered that when i was
    experimenting with setting the Table Properties the image was
    actually occasionally visible!!
    Short version: When formatting a cell containing a Flash
    animation dont leave the H field blank or use % (even though you're
    suppose to be able to!), use pixels instead - otherwise the Flash
    image collapses/disappears. Blank and % are fine everywhere else
    (I did type a long answer before, but it got eaten by the
    forum monster
    Someone/i will probably figure out
    why this is so or maybe i've just rediscovered the wheel
    here - but thats not really important now - because my Flash
    animation now renders similarly across IE, Opera and FireFox !!
    So thanks for your help!
    Daren

  • Table Cell Contents Disappears Please HELP!!!!

    PROBLEM: I have a different tables within different table cells in the Master table. One table per Master cell. Once I click on a table cell (0,0) and click on another table cell (1,1) the cell (0,0) blanks out. Likewise with other cells so that if I've click on all the cells in the Master Table and then clicked somewhere else all cell contents have disappeared.
    QUESTION: Do I need to call some UI refresh procedure????? I have a cell renderer which returns the table for each Master's Cell.
    I don't if this is clear but please help!
    Thanks

    Hi,
    the problem is that the DefaultCellEditor can't handle tables.
    So you have to write your CellEditor, which returns another table as Editor.
    class YourTableCellRenderer implements  TableCellRenderer{
        private  JTable table = new JTable();
        public Component getTableCellRendererComponent(JTable table,
                                                       Object value,
                                                       boolean isSelected,
                                                       boolean hasFocus,
                                                       int row,
                                                       int column){
             // set Data and Layout
             return table;
    }then set the Editor to your MasterTable (master) with.
    master.setCellEditor(TableCellEditor anEditor) or
    master.setDefaultEditor(Class columnClass,
                                 TableCellEditor editor);Hope this Helps.
    Michael

  • Wrapping table cell contents

    Hi
    I have a requirement where i need to wrap my table cell contents.I have chekced all the properties of table but none serves my purpose.Kindly help in this direction.
    NWDS version : 7.3
    Server version : 7.3 SP02
    Thanks
    Monika

    Hi Monika
    Wrapping property is not available at table level.
    The individual columns header and content in the text views only you can wrap.
    If the table column cell editor is a Text View , then you can see the Wrapping property and you can change it to true for wrapping.. For column headers also you can set the property.
    Regards
    Venkata KALYAN

Maybe you are looking for

  • Function Logic

    Hi All, I created a function call which builds a WHERE clause CREATE OR REPLACE FUNCTION test(p_organization_in IN VARCHAR2) RETURN VARCHAR2 IS v_where_clause VARCHAR2(1000); CURSOR c_cur IS SELECT organization, channel_id, hierarchy_id FROM applicat

  • Can't do attachments in hotmail

    Attachments no longer work in hotmail. "Attachment" word stays grey and nothing happens

  • Using RSL ? or not !

    I have just discovered a strange behaviour of the Flash Player with the Flex framework RSL. When you compile you Flex application with RSL linkage, the RSL framework is downloaded only once for all the Flex applications. In fact this is true only if

  • Text from Design view is not visible on View

    I converted a project from RoboHelp 9 to 11, and discovered that several of my topics were changed.  Most of the changes were minor, e.g. spacing, bold type, bullets, etc., but I'm still having to go through each page, to make corrections.  Oftentime

  • BIServer Discovery on OEM 11g

    Hello All, I am trying to add the BI Suite EE on OEM 11g to monitor and am using the oracle doc :: http://docs.oracle.com/cd/E11857_01/install.111/e12639/chapter1.htm. Please scroll down to discovering the BI suite EE in OEM screenshot and it is fail