WordPress.org

Forums

Tables verses Divs (11 posts)

  1. myallenmedia
    Member
    Posted 2 years ago #

    There's still a huge debate over the usage of tables verses divs in plugin development so I wanted to get other opinions on the subject. When developing a wordpress plugin, what would you rather use to be more usable with all the thousands of themes out there. Tables or divs and why?

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Divs in the vast majority of cases. Tables should never be used for purely presentational purposes and they can be far harder to style than divs.

  3. myallenmedia
    Member
    Posted 2 years ago #

    Is it also true that tables can cause different display issues under different themes? The idea is to have divs all working under all themes.

  4. esmi
    Forum Moderator
    Posted 2 years ago #

    Yes - in that the tables could be styled quite differently in the theme's stylesheet. But then it would be quite reasonable to assume that the plugin's display using divs might still need some tweaking in a random theme., I think the best bet us to use divs, apply some basic CSS that works when the plugin is used with the current default theme and let everyone else look after the CSS (if necessary) in their themes.

  5. Andrew
    Nuh uh moderator
    Posted 2 years ago #

    There's still a huge debate over the usage of tables verses divs

    Why? They serve different purposes and are both useful.

    They can both be misused.

  6. esmi
    Forum Moderator
    Posted 2 years ago #

    How can you misuse divs? They have no semantic meaning - unlike (say) table markup.

  7. Andrew
    Nuh uh moderator
    Posted 2 years ago #

    Using a div for the purpose of a table, or a table for the purpose of a div.

  8. Tables are for tabular data

  9. myallenmedia
    Member
    Posted 2 years ago #

    All good info!

  10. esmi
    Forum Moderator
    Posted 2 years ago #

    Using a div for the purpose of a table

    Fair point :-)

  11. Andrew
    Nuh uh moderator
    Posted 2 years ago #

    The fairer point was analysing what purpose a div has, made by you. It has no overall purpose, but only in the context of its usage, whereas a table has an overall purpose.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags