Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Deleting cells by name instead of index?

Reply
Thread Tools

Deleting cells by name instead of index?

 
 
Rich Morey
Guest
Posts: n/a
 
      06-05-2004
Hi,

I have a table where I am altering the layout via javascript to create
colspans. I want to then delete the "Extra" cells created by the
colspans.

I have named the cells "r1c1", "r1c2", "r2c1", etc..

document.getElementById('r2c2').colSpan="4"
cellRows = document.getElementById('tableChart').rows(1);
cellRows.deleteCell(2);
cellRows.deleteCell(2);
cellRows.deleteCell(2);

document.getElementById('r2c7').colSpan="4"
cellRows = document.getElementById('tableChart').rows(1);
cellRows.deleteCell(4);
cellRows.deleteCell(4);
cellRows.deleteCell(4);

This code works because when I'm working on r2c7, I know that I've
already deleted three cells above and so the next cells to delete are
column index of 4.. but what I'd like to be able to do is delete the
cells by name, in this case
'r2c8', 'r2c9', and 'r2c10'

Is there anyway to do that? I tried just

document.getElementById('r2c8').deleteCell()

but that gave me a javascript error..

Thanks,

Rich
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert yyyymmdd text cells into date cells =?Utf-8?B?ZF9jYW1wZWxvQGhvdG1haWwuY29t?= Microsoft Certification 2 11-22-2006 04:52 PM
Writing to Cells in the Detailsview Insertmode makes cells uneditable. SixStringSlaya@gmail.com ASP .Net 0 02-28-2006 10:23 PM
Deleting cells by name instead of index? Rich Morey Javascript 6 06-08-2004 02:50 AM
Array information into 2 cells instead of 1? Laurey Perl 2 01-30-2004 02:44 AM
Cells[].Text or Cells[].Controls[0] Joel Finkel ASP .Net Datagrid Control 0 09-01-2003 04:42 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57