Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 27-07-2009
Member
 
Join Date: Oct 2008
Posts: 65
How to create div around table rows

I have been using the ASP.NET AJAX UpdatePanel control a lot lately for some intranet apps I've been working on, and for the most part, I?m trying to apply a style to the text of several rows of a table. I only want to apply the style to some of the rows not all. I have been using it to dynamically refresh data or hide and show controls on a form based on the user's actions. I would like to hide or show a group of rows in a table. I tried wrapping those rows with a div, then I tried a span. Neither worked.
Reply With Quote
  #2  
Old 27-07-2009
Member
 
Join Date: Apr 2008
Posts: 193
Re: How to create div around table rows

Table rows are really tricky. You shouldn't wrap a div around rows, because it isn't valid. The one element that is intended for this is tbody. Multiple tbody tags are perfectly fine, too. why not just <table id="divTable" ...> you don't need to put extra div element here.
Quote:
<div style="display: block" id="divRow">
First, you can try to style up with fixed height and overflow the <tbody> using <thead> for the table header.
Reply With Quote
  #3  
Old 27-07-2009
Member
 
Join Date: Jan 2009
Posts: 143
Re: How to create div around table rows

Use 'table-row-group' instead of 'table-row' & you can hide/show multiple rows at a time without creating a million document.getElementById() calls. Is there however anything else that would allow me to 'grab' a hold of all the 'encapsulated' objects (as they are by div) and deal with them from that (higher) level.
Reply With Quote
  #4  
Old 27-07-2009
Member
 
Join Date: Mar 2008
Posts: 227
Re: How to create div around table rows

If you are dynamically creating your controls, you can decide which things to display or hide while generating your controls. If the columns of the two tables aren't aligned, you can always force via css the cells of the header of the containing table and the cells of the content table to have same width. $('table#yourid tr').slice(3,7).css('display', 'none');

HTML becomes invalid if you use div or span between table rows. UpdatePanels (or AJAX postbacks in general) should not be used to just hide or show elements.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to create div around table rows"
Thread Thread Starter Forum Replies Last Post
Want help to create roll up rows in Microsoft Excel Ambition MS Office Support 2 24-02-2012 07:21 PM
How to create fixed lengh cell and rows in Microsoft Excel Henriksen MS Office Support 2 21-02-2012 05:52 PM
Cannot highlight distinct cells in different rows and column in a Pivot table ? Grayson Windows Software 3 27-11-2010 05:25 AM
Page break between table rows in html Zool Software Development 2 11-08-2009 02:38 PM
Merging duplicate names not rows copy rows into new workbook each time VBA Excel 2003 awkwardsmile Software Development 2 09-07-2009 08:57 AM


All times are GMT +5.5. The time now is 07:59 PM.