469,282 Members | 2,217 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

Table cells don't inherit borders in IE6

URL: http://philevans.com/tabletest.html

A boring table, but one which illustrates my problem. I'm writing a
large PHP app which outputs data tables. Users of the app can configure
their preferences for table border width, colour, style etc . . . I
don't have access to the main stylesheet from the PHP, so the border for
the table is going inline, thus:

<table id="testTable" style="border: 1px dotted red;">

However, user specified borders need to apply to the table cells as well
as to the external border of the table itself. Initally I thought that I
could write

#testTable td { border: inherit}

in the main stylesheet (in the real app I'm actually inheriting from a
class .userStyledTable but the idea's the same), which didn't work; I
then realised that the cell would be trying to inherit from the tr and
the tbody, which have no borders. Adding

#testTable thead, #testTable th, #testTable tbody, #testTable tr,
#testTable td { border: inherit; }

makes things work as I want in Firefox, but not in IE6. Any ideas how I
can achieve what I want? To reiterate:

- I can write dynamic inline styles to the table easily
- I can't really write dynamic styles to the HTML head or the
stylesheet, since I don't know "in time" what styles I'll need, and it's
a lot of work to find out
- I can write any static styles I want (e.g. the border: inherit) to the

Any ideas or suggestions?
Jul 20 '05 #1
0 2231

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Rick DeBay | last post: by
7 posts views Thread by Bob Bedford | last post: by
1 post views Thread by sam | last post: by
11 posts views Thread by Norman L. DeForest | last post: by
10 posts views Thread by phil-news-nospam | last post: by
17 posts views Thread by Grant Kelly | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.