html - CSS nth-child all elements appearing as "odd" -


I have a table of HTML & amp; Want to apply CSS and N-th Child Chooser so that I can change colors between table rows.

For some reason, each line is displayed in the same color.

The same question on A stack overflow says that the n-th child selector applies to that element, not the child. I understand it, and I have another table class that works properly Is, but my second table class which I do not want to apply it.

I have tried to implement the Working Table class in several tables. On some tables, it works on others, it is not so.

CSS:

  .prevTable {table-layout: fixed; Degradation: collapse; Padding: 3px; Boundary-radius: 3px; Font size: 13px; Margin-left: 0 pixels; Width: 860px; } .prevTable th {padding: 6px 3px 6px 3px; Background color: #CCCCCC; Font-family: rally; Text align: center; Boundary-radius: 3px; Border: 1 px solid gray; } .prevTable td {padding: 5px; Font-family: rally; Border: 1 px solid gray; Text-align: left; } Table.prevTable tr: nth-child (even) {background color: # E6E6E6; } Table.prevTable tr: nth-child (Strange) {background-color: # C9C9C9; }   

HTML table:

  & lt; Table class = "prevTable" & gt; & Lt; Thead & gt; & Lt; TR & gt; & Lt; Th & gt; Parameters & lt; / Th & gt; & Lt; Th & gt; Price & lt; / Th & gt; & Lt; / TR & gt; & Lt; / Thead & gt; & Lt; Tbody & gt; & Lt; Tr & gt; & Lt; Td> Some content & lt; / Td> & Lt; / Tr & gt; & Lt; Tr & gt; & Lt; Td> Some content & lt; / Td> & Lt; / Tr & gt; & Lt; Tr & gt; & Lt; Td> Some content & lt; / Td> & Lt; / Tr & gt; & Lt; Tr & gt; & Lt; Td> Some content & lt; / Td> & Lt; / Tr & gt; & Lt; / Tbody & gt; & Lt; / Table & gt;  

--text "itemprop =" text ">

  & Lt; Table class = "prevTable"> gt; & lt; thead & gt; & lt; tr & gt; & lt; th & gt; parameter & lt; / th & gt; & lt; th & gt; value   & lt; / tr & gt; & lt; tr & gt; & lt; td & gt; One td = table cell (or table data) is required & lt; / td & gt;     Some Content    Tr & gt; & lt; td & Gt; Certain Content & lt; / td & gt; & lt; / tr & gt; & lt; / tbody & gt; & lt; / table & gt;   

slow Att:: & gt;

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -