typo
I left out the : in the border
change this
border 1px solid black;
to this
border: 1px solid black;
jAy
Main Topics
Browse All TopicsHow do I apply style to my html document so that only the inner most tables are affected? The reason I don't want to use the class attribute is I want to make it totally dynamic.
Here's an example:
<TABLE>
<TR><TD>
<TABLE>
<TR><TD>
<TABLE> <!-- Affected -->
<TR><TD>
</TD></TR>
</TABLE>
</TD></TR>
</TABLE>
</TD></TR>
</TABLE>
<TABLE> <!--Affected-->
<TR><TD>
</TD></TR>
</TABLE>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
This will do :
<html>
<head>
<title>about:blank</title>
<script language="javascript1.2">
<!-- copyright(c) avcoh@yahoo.com
-->
</script>
<style>
TABLE TABLE TABLE {border:1px solid black}
</style>
</head>
<body>
<TABLE>
<TR><TD>
<TABLE>
<TR><TD>
<TABLE> <!-- Affected -->
<TR><TD>
</TD></TR>
</TABLE>
</TD></TR>
</TABLE>
</TD></TR>
</TABLE>
<TABLE> <!--Affected-->
<TR><TD>
</TD></TR>
</TABLE>
</body>
</html>
Notice the CSS :
TABLE TABLE TABLE {border:1px solid black}
This will apply the border only to a table that is a child of a table, that is a child of another table.
As I have said, the reason for not having any attribute in the tags is to make them dynamic. Anyway, avner, your code doesn't work for the second table.
i'll be able to accomplish what i want if i can select a parent or parents of a tag. However, it seems like there isn't any selectors for selecting a parent in css or css2. hope i don't have to resort to using javascript.
i have many more questions awaiting for answer/comment. please help.
Jux83, it works for me , I added intendation to better show it :
<html>
<head>
<title>about:blank</title>
<script language="javascript1.2">
<!-- copyright(c) avcoh@yahoo.com
-->
</script>
<style>
TABLE TABLE TABLE , TABLE TABLE{border:1px solid black}
</style>
</head>
<body>
<TABLE>
<TR>
<TD>Not to be effected
<TABLE>
<TR>
<TD>to be effected
<TABLE>
<TR>
<TD>to be effected</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<!--Affected-->
<TABLE>
<TR>
<TD>to be effected</TD>
</TR>
</TABLE>
</body>
</html>
What browser are you testing it on ?
I agree with Jay, if you are generating dynamically what is the issue just insert a class, id, or put the styling inline. Why are you looking for a complicated solution for something simple? The reason for using dynamic generation is so you have real time control, and there is no reason the realtime control cannot include the styling.
Cd&
Business Accounts
Answer for Membership
by: jaysolomonPosted on 2003-05-11 at 19:30:42ID: 8506386
gice it a id attribute
<html>
<head>
<title>Blah</title>
<style type="text/css">
<!--
#whatever{
width: 100%;
border 1px solid black;
background-color: blue;
color: red;
}
//-->
</style>
</head>
<body>
<table id="whatever">
<tr>
<td>Hello World</td>
</tr>
</table>
</body>
</html>
jAy