www.webdeveloper.com
Results 1 to 1 of 1

Thread: problem with relative positioning and table cell height

  1. #1
    Join Date
    Oct 2009
    Posts
    65

    Question problem with relative positioning and table cell height

    See screenshot attached.

    I want to set up a table so that error messages appear directly above specific table columns in the form of a div tag with a red background and the same width as the column.

    To do this I've added a div tag inside the <th> element of the table, with the display property set to 'none'.

    Code:
    <th>
       <nobr>Header Content</nobr>
       <div id="error_message">Error Message</div>
    </th>
    When I want to display an error message above the table I use the following styles on the div tag

    Code:
          background-color: #ffcccc;
          width: 100%;
          position: relative;
          left: 0px;
          top: -100px;
          z-index: 1;
          display: block;
    It displays the div tag above the header like I want, but it still stretches the height of the <th> element as if it was still contained inside of it. How do I do this without stretching the cell height?
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles