|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Nested tables problem
i have nested tables but table inside is inheriting properties from table outside. i have written classes for both tables in css and i dnt want inside table to inherit. what can i do?
|
|
#2
|
||||
|
||||
|
Apply a seperate ID for that table and specify the properties otherwise...not difficult.
Cheers
__________________
"Quality of responses may vary. I reserve the right to change my mind for any reason what-so-ever without admitting I was wrong. I'd prefer to change your mind however, it's easier on my ego". - jwdonahue |
|
#3
|
||||
|
||||
|
Quote:
You could still implement pure class selectors which are reusable instead of id selectors which are not if you take care about how you define your selectors. Here is an example done completely with class selectors Code:
<style type="text/css">
<!--
.styledTable td{
background:#999;
}
.styledTable table td {
background:#F00;
}
-->
</style>
Code:
<table class="styledTable" width="100%" border="1">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><table width="100%" border="1">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table></td>
</tr>
</table>
<table class="styledTable" width="100%" border="1">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><table width="100%" border="1">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table></td>
</tr>
</table>
![]() You still have much to learn ![]()
__________________
PHP Code:
Last edited by holodoc : June 24th, 2009 at 02:50 PM. |
|
#4
|
|||
|
|||
|
thanks for the reply...i have started web programing a few days before..using a book html for dummies..and using Dream weaver's code and design view..can u guide me where to go?..wht to learn?..how can i be a professional in web programing?
Quote:
|
|
#5
|
||||
|
||||
|
I still have much to learn? I'm better then you at CSS. He did not say there were going to be multiple tables, in which in your example. If he set the background color in a class. He could just add in a class after the first class andt hat would override. You didn't think of that did you? Guess you have much to learn. How about throwing in some CSS3 selectors in there just to be a pain in the ***? You have no idea the extent of my CSS knowledge. I may not have experience with clients, but I sure as hell can whip your a$$ when debugging a CSS problem.
|
|
#6
|
||||
|
||||
|
First rule of thumb when you are dealing with CSS is "keep it simple"
If you get used to making complex CSS styles you will very soon start to loose your hair. Avoid using hacks and similar stuff and try to resolve your CSS issues by thoroughly analyzing how you can bend the rules that can't be broken Here are some good links you could use to start over with. http://www.w3schools.com/css/ - perhaps the most important one for beginners http://matthewjamestaylor.com/blog/perfect-3-column.htm - here you will learn some very good things about how to make good and browser compatible layouts. http://www.brainjar.com/css/positioning/ - this is a must if you intend to learn basic rules about positioning. It can be a little bit bitchy to grasp all of the concepts regarding CSS positioning. http://css.maxdesign.com.au/ - here you will learn some very interesting things about floats, lists etc. http://www.positioniseverything.net/ - your content is not displayed as it is supposed to in one or more of the browsers? You can look up this link to see if there is something you need to be careful about. http://www.quirksmode.org/ - this site is not specialized with CSS but it has some very interesting articles which you should read or at least consult once in a while. There are lots of additional links you can find online but you might wanna look up the sticky thread in this part of the forum. http://forums.devshed.com/css-help-...ces-225165.html Once again if you intend to make good CSS code keep it simple and try to understand how properties are inherited. |
|
#7
|
||||
|
||||
|
Quote:
![]() |
|
#8
|
||||
|
||||
|
Quote:
I get to use all of CSS1? Good enough for me. Shall I PM it to you? I'm already halfway done. And to make it more fair for you I am doing it in IE5.5 ok? |
|
#9
|
||||
|
||||
|
Quote:
What? You can't do it in IE 4? ![]() |
|
#10
|
||||
|
||||
|
Can't find a download of it. By the way you are talking, I am assuming you don't think ID selectors exist in CSS 1?...Hm..when I finish this, I might just convert it to HTML 2..nevermind, that will throw IE into quirksmode..
|
|
#11
|
||||
|
||||
|
Uhm, you do realize that all of your selectors or properties were introduced in CSS1. So basically there is no need for me to even recreate the above code...
Dumbas$... |
|
#12
|
||||
|
||||
|
Quote:
http://www.w3.org/TR/REC-CSS1/ Its the specification for CSS1 which was the first CSS I ever used in my life and that was almost 13-14 years ago. And you know what? Even then there was a restriction which said that you can't have multiple elements with the same id if you want to stay valid Sounds familiar? CSS 101 ![]() Quote:
Bottom line being you can't do that what you were up to So stop whining and get yourself a glass of milk to calm down your nerves. Then look at my post above and try some of the links I gave to the OP. You might find them useful next time when you claim that you can do something that can't be done ![]() Last edited by holodoc : June 24th, 2009 at 04:29 PM. |
|
#13
|
||||
|
||||
|
Who said I was using mulltiple ID's? All I need is to modify the class idea i had before. Because of the specifity, it will override the previous declarations. Sound familiar? CSS 101
|
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > Nested tables problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|