Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
seeking workaround: position:relative on TR strips styles from TD's within
Old 08-26-2008, 05:15 PM seeking workaround: position:relative on TR strips styles from TD's within
seannarae's Avatar
Skilled Talker

Posts: 65
Location: san francisco, ca
Trades: 0
I have a table containing lots of data:
- multiple columns
- what will be dozens & dozens of rows

The table is styled to suit using CSS on TABLE, TR and TD.

Client wants header row (TR) to be frozen whilst the rows scroll beneath (think: freeze panes in Excel).

I'm achieving this by setting that TR (class="headrow") to position:relative.

However, doing so strips-off the BORDER styles on the TD's within the TR. But not the other styles. Seems to effect only the BORDERS. Strike the RELATIVE, the borders come back.

Can anyone provide a workaround to this? How i can get borders on a TD to render when the TR containing them is position:relative?

THE CSS
Code:
.wrap {
    height:200px;
    width:680px;
}

table.xyz {
    padding:0px;
    margin:0px;
    width:680px;
    border:0px;
    border-collapse:collapse;
}

table.xyz td {
    padding-left:2px;
    vertical-align:top;
    text-align:left;
    border-bottom:1px solid #000000;
    border-right:1px solid #000000;
}

table.xyz tr.headrow {
    font-weight:bold;
    background-color:#999999;
    position:relative;
}

table.xyz tr.odd {background-color: #FFFFFF;}
table.xyz tr.even {background-color: #EBEBEB;}
EXAMPLE OF HTML
HTML Code:
<div class="wrap">
<table class="xyz" cellpadding="0px" cellspacing="0px">
    <tr class="headrow">
        <td>Column 1</td>
        <td>Column 2</td>
        <td>Column 3</td>
        <td>Column 4</td>
    </tr>
    <tr class="odd">
        <td>Data</td>
        <td>Data</td>
        <td>Data</td>
        <td>Data</td>
    </tr>
    <tr class="even">
        <td>Data</td>
         <td>Data</td>
         <td>Data</td>
         <td>Data</td>
    </tr>
</table>
</div>
seannarae is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-26-2008, 08:18 PM Re: seeking workaround: position:relative on TR strips styles from TD's within
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Instead of using a <tr> try using an actual TH and style the TH the way you want it, leaving the 'plain' old <tr>'s alone.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to seeking workaround: position:relative on TR strips styles from TD's within
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.67109 seconds with 12 queries