Hello- I''d like to throw a little AJAX into a table to allow the user to edit a single row of data inline rather than moving to another page. The row (which has N columns) would be swapped out for a row which has a single column (colspan="N") and the form inputs would be in that row. My question is, is this legal HTML? I can''t find anything that says either way. Basically, I''m thinking the HTML would look like: ... <tr><div id="item_43"> <td>blah</td> <td>blah</td> </div></tr> <tr><div id="item_44"> <td>blah</td> <td>blah</td> </div></tr> ... During the AJAX call, "item_44" would get replaced with something like: <td colspan="2">...Edit Blah...</td> Is this ok? Jake -- Posted via http://www.ruby-forum.com/.
Hi Jake, Just add the id to the <tr> .... so <tr id="item_43"> <td>Whatever</td> <td>Whatever</td> </tr> You should not use <div>''s when you don''t need to. Always try to use a already existing tag before resorting to a div. Eric Jake Janovetz wrote:>Hello- > >I''d like to throw a little AJAX into a table to allow the user to edit a >single row of data inline rather than moving to another page. > >The row (which has N columns) would be swapped out for a row which has a >single column (colspan="N") and the form inputs would be in that row. > >My question is, is this legal HTML? I can''t find anything that says >either way. Basically, I''m thinking the HTML would look like: > >... ><tr><div id="item_43"> > <td>blah</td> > <td>blah</td> ></div></tr> > ><tr><div id="item_44"> > <td>blah</td> > <td>blah</td> ></div></tr> >... > >During the AJAX call, "item_44" would get replaced with something like: > ><td colspan="2">...Edit Blah...</td> > >Is this ok? > > Jake > > >-- Eric Goodwin ericgoodwin.com
Eric Goodwin wrote:> Hi Jake, > > Just add the id to the <tr> .... so > > <tr id="item_43"> > <td>Whatever</td> > <td>Whatever</td> > </tr> > > You should not use <div>''s when you don''t need to. Always try to use a > already existing tag before resorting to a div. > > Eric > > Jake Janovetz wrote: > >> >>... >> > -- > Eric Goodwin > ericgoodwin.comAlso, for the record, adding a div inside a tr directly is against XHTML standard (http://learningforlife.fsu.edu/webmaster/references/xhtml/tags/table/tr.cfm). -- Posted via http://www.ruby-forum.com/.
> Also, for the record, adding a div inside a tr directly is against XHTML > standard > (http://learningforlife.fsu.edu/webmaster/references/xhtml/tags/table/tr.cfm).Thanks. This is what I was after. Though, for this particular case, the ID''ed <TR> will work just fine. Thanks! Jake -- Posted via http://www.ruby-forum.com/.