The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> how to control indents in a table?, using <td><ul><li>
tebk77
post Sep 13 2010, 03:16 PM
Post #1


Newbie
*

Group: Members
Posts: 19
Joined: 7-October 09
Member No.: 9,953



One thing is resolved and then comes another issue! This time I used the validator for the .css and xhtml.

How do you control an indent in a table? I've looked several places and suggestions haven't worked. Of course it's probably something I've done! blink.gif

Here is the URL :
http://www.frankfordfriendsschool.org/give-auctionFFS1.html

The .css code (for the table) is within the .html file below:
CODE
<style type="text/css">

table {
    width:340px;
    margin:0 auto;
    padding:5px;
}
td img {
border:none;
}
td.left { /* 1st td */
    padding-top:8px;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:10px;
    font-weight:normal;
    vertical-align:top;
    text-align:left;    
    width:45%;
}
td.mid { /* 2nd td */
    padding-top:8px;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:8px;
    font-weight:normal;
    width:10px;
}
td.right { /* 3rd td */
    padding-top:8px;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:10px;
    font-weight:normal;
    vertical-align:top;
    text-align:left;
    width:45%;
}

td.left ul li, td.right ul li{
    width:100%; margin-left:0px; padding-left:5px; list-style-type:none;
}

</style>


Could the code in the mainstyles2.css file is affecting the indent in the table?
http://www.frankfordfriendsschool.org/mainstyles2.css
However, I always thought that the css codes in the html file will override the codes in external file. Is that true?





User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Sep 13 2010, 03:37 PM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,289
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



The margin specified in the rule for "#content ul li" has higher specificity than the rules for "td.left ul li" or "td.right ul li" or "*". See
http://www.w3.org/TR/CSS2/cascade.html#specificity

QUOTE
However, I always thought that the css codes in the html file will override the codes in external file. Is that true?
No. Rules found in an element's style attribute have the highest specificity, but rules found in a document's style element are treated the same as rules found in an external style sheet.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 25 2010, 12:36 AM
Post #3


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,133
Joined: 9-August 06
Member No.: 6



Just to add to what Darin said, if you have competing declarations with equal specificity both in an external style sheet and in a style block, as always the actual order they come in is what decides which wins. So putting the embedded style block before or after any LINK elements can make a big difference.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th February 2019 - 06:02 PM