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.

Use DIVs or TABLES for creating tables?

Discussion in 'HTML & Website Design' started by Mr.Dog, Feb 27, 2013.

  1. charlijoseph

    charlijoseph Greenhorn

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #21
    As per your requirement and my personal experience i would suggest to use div tag .
     
    charlijoseph, Mar 4, 2013 IP
  2. Mr.Dog

    Mr.Dog Active Member

    Messages:
    912
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    60
    #22
    I see the vast majority of people here are for DIVs. Sorry DeathShadow, man!

    But I guess you are right about keeping things in order: DIVs are indeed intended for styling, building up the main structure and tables are indeed intended for tables.

    But my next tables are so simple and instead if creating the <table><td><tr> stuff, I think I could make it simpler/running faster with DIVs. And I could repeat the same DIV classes and it would make the code even simpler...

    I will give it a try with DIVs for the sake of simplicity and speed. Although in the past I was using tables.
     
    Mr.Dog, Mar 4, 2013 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #23
    I'm sure deathshadow will be ever so upset. The fact is, it doesn't matter what the "vast majority" are for, it only matters that they are wrong on this topic. HTML is a declaratory, structural markup language, and it defines the table structure as the correct markup for positionally related data. That's what we're talking about here.

    You want to know the difference? Take your "div" markup without a stylesheet and see how much sense it makes. Try none.

    That the "vast majority" vote for non-table markup is simply a sharing of ignorance.

    g
     
    kk5st, Mar 4, 2013 IP
    malky66 and sarahk like this.
  4. malky66

    malky66 Acclaimed Member

    Messages:
    3,996
    Likes Received:
    2,248
    Best Answers:
    88
    Trophy Points:
    515
    #24
    Well i hope next time you ask for advice, as you do on a regular basis... the only people that "help" you are the stupid ignoramuses that know absolutely nothing about the subject, i:e all the idiots telling you to use div's to display tabular data, and i hope deathshadow who is the only person in this thread taking the time to give you correct information doesn't give you any more help, you don't deserve it.
     
    malky66, Mar 4, 2013 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #25
    Notice most of the "use a div" re-re's are barely english speaking low post count one-line wonder-****'s? ... and you're listening to THOSE dipshits?

    Of course I'm not seeing how you could make it simpler, or faster for that matter using DIV since you'd be dicking with floats, using classes on damned near everything over and over and over again... that would be MORE markup, and as such MORE bandwidth and SLOWER loading.

    Much less the entire thing as only DIV would in fact have no semantic meanings and therein be one giant run-on sentence on the accessibility front. Does this:
    Supplement Facts Serving Size: 1 Tablet Amount Per Serving % Daily Value Vitamin A (50% as beta carotene) 3500 IU 70%< Vitamin C 50 mg 100% Vitamin D 400 IU 100% Vitamin E 30 IU 100%
    Code (markup):
    Make any sense as a single non-stop run-on sentence? No, it doesn't -- and that's what using just DIV or SPAN means because DIV and SPAN are semantically neutral -- they provide NO grammatical structure. That's why when you group tags using DIV or data using SPAN, you should ALSO have semantic tags in place so the content makes sense (like numbered headings, paragraphs, lists, etc).

    Of course if you want to go the "what it looks like on my screen to hell with everybody else" approach, go right ahead and piss all over accessibility and usability by listening to the one line wonder posters lacking enough brain cells to rub together to make even the tiniest spark.
     
    deathshadow, Mar 5, 2013 IP
  6. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #26
    OK, lets set a challenge. The OP shows us his table as a single page with the css etc on the page rather than in a separate file. Those who are interested then recreate the table with their chosen method and we compare file sizes and load speed.

    Who is keen?
     
    sarahk, Mar 5, 2013 IP
  7. browntwn

    browntwn Illustrious Member

    Messages:
    8,347
    Likes Received:
    848
    Best Answers:
    7
    Trophy Points:
    435
    #27
    The hard part about asking a question on a forum where both idiots and knowledgable people answer is knowing which one is which. Apparently the OP feels more comfortable with the idiots. C'est la vie.
     
    browntwn, Mar 5, 2013 IP
  8. creationsweb

    creationsweb Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #28
    The use of tables is gradually diminishing. Programmers prefer using div. No doubt, the use of div makes programming easier and shortens the code to a great extent. Moreover, a lot of problems are incurred while using table.
     
    creationsweb, Mar 6, 2013 IP
  9. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #29
    This bit I really don't get. I've been coding for the better part of two decades and I just can't see how the php script or the output html are so much shorter.
     
    sarahk, Mar 7, 2013 IP
    malky66 likes this.
  10. malky66

    malky66 Acclaimed Member

    Messages:
    3,996
    Likes Received:
    2,248
    Best Answers:
    88
    Trophy Points:
    515
    #30
    If you mean using tables for design then it's a good thing but there is no reason to use a div to display tabular data...use a table that's what they are for.
    In what way??...you need to explain that one

    What problems???...it's only a problem when *programmers* don't use them correctly otherwise there is nothing wrong with using them.

    Again you just look like someone commenting on a subject you know jack shit about.
     
    malky66, Mar 7, 2013 IP
  11. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #31
    And that usually occurs when the "programmer" in question is as much a programmer as an apple is a duck. Brontwn's comment is dead on.
     
    Rukbat, Mar 8, 2013 IP
  12. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #32
    It usually isn't... quite often you can do things with tables in LESS code because of all those extra semantic tags -- which typically mean you don't NEED classes, ID's, etc, etc... By the time you stack a bunch of meaningless endless nested DIV it's typically going to be more code, JUST because of that.

    Though again, code size and speed aren't the REAL reason this should be a table, they're a nice side effect. The REAL reason is that it provides MEANING to the DATA instead of it being a pointless run-on with no semantics whatsoever. That's why the people saying "Use DIV" for this are a bunch of ignorant halfwits who don't know enough about HTML to be flapping their gums on the subject, needing a nice big double helping of Sierra Tango Foxtrot Uniform.
     
    deathshadow, Mar 8, 2013 IP
    kk5st likes this.
  13. Mr.Dog

    Mr.Dog Active Member

    Messages:
    912
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    60
    #33
    Too much controversy, some of you are making a big deal, not to mention harassing each other and offending those who have other opinions.

    DeathShadow's responses have interesting concrete points there, well-elaborated and I appreciate the technical explanations. Now I understand more about the advantages/disadvantages.

    Thanks - but only to those who posted useful responses and haven't insulted anyone!
     
    Mr.Dog, Mar 17, 2013 IP