[Pro] Is this possible? (special table request)

I am guessing that you are getting inconsistent results because you have styled the text in your table cells by highlighting it and applying a style with the Inspector. You’re getting a span, most likely with a number in its name, like style42, and that number might be getting replaced by my ultra-simple code.

If you want to have a really bulletproof experience here, try creating a style based on the name of your table, like this:

#box1 td { font: 11px Verdana sans-serif; }

Then don’t style the text in that table at all. It won’t look right in Freeway, but it will look right when you preview or look in a browser.

Now when you loop through it and replace numbers with other numbers, you won’t have that problem.

Also, you could use further refinements in the script to make sure you were really only targeting the text in the cell, not any of the outer html surrounding that point:

$$('#box1 tr').each(function(elm,idx){
	var cell = elm.down('td'); // the first cell only
	cell.innerHTML = cell.innerHTML.gsub(/d+/,(idx + 1));
});

If you want to have some letters in there, then just put AF1 in each cell, only the numbers will be replaced, the AF should remain untouched.

Walter

On May 10, 2012, at 9:14 PM, DeltaDave wrote:

To get it to work on only one table

$$('#box1 tr').each(function(elm, idx){
   elm.innerHTML = elm.innerHTML.gsub(/d+/, (idx + 1));
});

Where box1 is the Title of the Table you want to affect

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options