1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Table element's CSS properties that IE doesn't understand ??

Discussion in 'CSS' started by tayiper, May 12, 2006.

  1. #1
    You see, in the past few months I have beeing trying to "convert" as much of my HTML code as possible into the CSS ...


    So for example in case of tables, I started to use a table class: "<table class="multi">" instead of the usual "<table cellspacing="2" cellpadding="4">" etc. (for instance), set in the external .css file with the following code: "table.multi { border-collapse: separate; border-spacing: 16px; }" ), however, this obviously messed-up the layout if viewing the site in IE, i.e. there is no spacing between cells etc. etc.


    Therefore I am curious, is this because IE doesn't fully support CSS specification/standard (not completely sure which term is more appropriate), and AFAIK doesn't support CSS2 at all ??


    P.S. -- I got these two types of CSS-properties and values in the CSS tutorial on W3Schools site, and that's pretty much all, i.e. there aren't many other properties for a table selector


    tayiper
     
    tayiper, May 12, 2006 IP
  2. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #2
    Try using <table cellspacing="0"> on the table itself. Otherwise you can end up with some strange looking results in IE.
     
    AdamSee, May 12, 2006 IP
  3. johneva

    johneva Well-Known Member

    Messages:
    1,480
    Likes Received:
    46
    Best Answers:
    1
    Trophy Points:
    170
    #3
    If you wanna learn CSS properly you should not be using tables for layout really anyways as divs and CSS is the correct way to do layouts.

    But as for your table issue year you have to have certain values in the table tag cell padding and cell spacing being two of them.

    But be brave and learn how to do away with tables, tables are ment for displaying tabular data only not for full layouts.
     
    johneva, May 12, 2006 IP
  4. tayiper

    tayiper Active Member

    Messages:
    421
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    78
    #4
    Yes, but I thought that these two pieces od code (i.e. "border-collapse: separate" and "border-spacing: 16px") are somehow a CSS equivalent to HTML's "cellspacing" and "cellpadding" ...


    P.S. -- And on the W3Schools site in that CSS tutorial that I read and where I got this code in the first place (properties/values), there really weren't many other possible properties for a table selector except these two particular types.


    tayiper
     
    tayiper, May 12, 2006 IP
  5. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #5
    Try what I said.

    Tables are fine if you're using them to represent data, especially as CSS tables aren't supported well yet.
     
    AdamSee, May 12, 2006 IP
  6. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #6
    kk5st, May 12, 2006 IP
    AdamSee likes this.
  7. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #7
    if you need spacing for a specific table try

    <table style="padding-right: 10px; padding-left: 10px; padding-top: 10px; padding-bottom: 10px;">

    this is just a sample that u can use for a td also
     
    ludwig, May 13, 2006 IP
  8. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #8
    Ludwig, it's always best to seperate style from content as much as is possible, so for that unique table it would become:

    <table id="mytable">

    In style/CSS file

    mytable {
    padding: 10px;
    }
     
    AdamSee, May 13, 2006 IP
  9. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #9
    AdamSee you are right,

    I just wanted to make the example easy to understand :)
     
    ludwig, May 13, 2006 IP
  10. tayiper

    tayiper Active Member

    Messages:
    421
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    78
    #10
    Well thanks both. Ehm, I really didn't know that I could use "padding" with CSS in such manner, i.e. as mentioned, in that CSS tutorial on the W3Schools site, there really weren't many other possible properties/values for a table selector except those two types that I posted in the original post.


    P.S. -- And one more question. I am interested, is it possible to use a defined class and at the same time some additional attributes "in-line" on the same element ?? For instance consider this example below. I have the code below in my external .css file, and so when I "call" this class in a document, could I append some additional attributes just for this single element ??

    This code is in my external .css file:

    div.align {
        font-family: verdana, helvetica, sans-serif;
        text-align: center;
    }
    Code (markup):
    and I would "call" it somehow like this:

    <div class="align" style="width:760px;">the content of this particular div element</div>
    Code (markup):
    or maybe even like this (with HTML, not CSS):

    <div class="align" font size="+2" color="#FF0000">the content of this particular div element</div>
    Code (markup):
    tayiper
     
    tayiper, May 13, 2006 IP
  11. AdamSee

    AdamSee Well-Known Member

    Messages:
    422
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    135
    #11
    Again if you wanted to use something unique, I'd keep the style in the CSS file. You could do it like that, but what would be better would be in the example below.

    <div class="align" style="width:760px;">the content of this particular div element</div>

    Becomes

    <div class="align" id="sevensixty">the content of this particular div element</div>

    #sevensixty { width: 768px; }

    So instead you're using the ID to interact with the DIV. Remember IDs are for unique occurances only, so you should only use one ID with that name in the page, whereas class you can use tons of.
     
    AdamSee, May 13, 2006 IP
  12. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #12
    Hey tayiper,

    I think you should do what AdamSee proposes... its easier
     
    ludwig, May 17, 2006 IP
  13. tayiper

    tayiper Active Member

    Messages:
    421
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    78
    #13
    ... it's already done, thanks guys; here's a link to my "style.css" file.


    tayiper
     
    tayiper, May 17, 2006 IP