Results 1 to 4 of 4

Thread: How to create div around table rows

  1. #1
    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.

  2. #2
    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.
    <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.

  3. #3
    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.

  4. #4
    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.

Similar Threads

  1. Want help to create roll up rows in Microsoft Excel
    By Ambition in forum MS Office Support
    Replies: 2
    Last Post: 24-02-2012, 07:21 PM
  2. How to create fixed lengh cell and rows in Microsoft Excel
    By Henriksen in forum MS Office Support
    Replies: 2
    Last Post: 21-02-2012, 05:52 PM
  3. Replies: 3
    Last Post: 27-11-2010, 05:25 AM
  4. Page break between table rows in html
    By Zool in forum Software Development
    Replies: 2
    Last Post: 11-08-2009, 02:38 PM
  5. Replies: 2
    Last Post: 09-07-2009, 08:57 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,431,134.44945 seconds with 17 queries