WordPress.org

Support

Support » Miscellaneous » Tables verses Divs

Tables verses Divs

  • 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?

Viewing 10 replies - 1 through 10 (of 10 total)
  • esmi

    @esmi

    Forum Moderator

    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.

    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.

    esmi

    @esmi

    Forum Moderator

    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.

    Moderator Andrew Nevins

    @anevins

    Forum moderator

    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.

    esmi

    @esmi

    Forum Moderator

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

    Moderator Andrew Nevins

    @anevins

    Forum moderator

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

    Tables are for tabular data

    All good info!

    esmi

    @esmi

    Forum Moderator

    Using a div for the purpose of a table

    Fair point 🙂

    Moderator Andrew Nevins

    @anevins

    Forum moderator

    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.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Tables verses Divs’ is closed to new replies.
Skip to toolbar