WooCommerce STILL using TABLES????
-
Why is WooCommerce still using tables for layout for NON-TABULAR data?
The cart is not tabular data, it is a list. therefore it should be using
li
ordiv
tags.Other templates are using tables for small sections of content such as
order-details-customer.php
which are not tabular data.
-
Item | Item Cost | Qty | Total Cost
^ that could quite easily be tabular..you don’t agree?
The whole movement against tables was to do away with tables for layout purposes. This is not for layout. This is for data.
No, it’s not tabular data! Yes, it’s data but it’s not tabular data.
It is much better to do this using
divs
and it’s more scalable to make it responsive.I have basically destroyed all WooCommerce templates on every WooCommerce website I have built in the 6 months (about 8 sites)
This is the cart of one of the sites I have built. It is FULLY responsive down to mobile, which WooCommerce templates are not. It is re-constructed in
div
tags and taken 3 weeks longer than it should have.I don’t see how divs, unrelated to one another, are more relevant to this than a table? Look at what the cart displays. It displays rows of data, with columns common to all rows.
Item | Item Cost | Qty | Total Cost
Ignoring the intricacies of styling, the table in this case has more semantic value to the data being displayed than divs or an unordered list.
@nwr91 I’m not sure about this, because a
div
also has no semantic value.This kind of data is best read and indexed in a table format, because it is tabular data. In fact, arguably it could be better for SEO.
It will also be read better by screen readers for the visually impaired!
It’s more semantic to use divs. It makes it a hell of a lot easier to style up, and it’s responsive. It also looks neater.
The cart displays repeating sections of data, hence the foreach loop.
If you’re going to keep the tables, at least make them RESPONSIVE.
Most of the WC pages look terrible, and do not fit with a generic styling of a website. When developing award winning websites, woocommerce pages make the site look terrible.
Also, most of the templates are not developer friendly. variable.php on the single product add-to-cart directory is a mess and built on functions. More of the html needs to be in the template itself and not in the WC class functions.
If a
div
has no semantic value then neither does most other html tagsWhat are Semantic Elements? A semantic element clearly describes its meaning to both the browser and the developer. Examples of non-semantic elements: <div> and <span> - Tells nothing about its content. Examples of semantic elements: <form>, <table>, and <img> - Clearly defines its content.
Hence why I said
most
!
aside
etc are not semantic then..My point still stands.. WooCommerce uses tables unnecessarily! – I’ve remove more tables this morning from templates as the layout is terrible.
Also, Why does WooCommerce use a stupid colour scheme that does not fit with any site? What site uses pink?!
No color scheme or styling is going to match every site out there; if you don’t use a WC theme of course its down to you to make it fit with your custom theme using CSS or the ‘colors’ plugin if you’re a beginner.
James has been/will continue working on making tables responsive. We’re aware they can be annoying on mobile. But tables can still be styled, and the cart is definitely tabular.
The tables include:
– Cart
– Orders
– VariationsAll of which could be argued as tabular data. The rest of the catalog is list based.
Just feeling like you’re ranting unnecessarily now anyway r/e color ?? If you feel you can contribute to development positively, the repo is here https://github.com/woothemes/woocommerce
Maybe making the default colours easier to override would help.
I work for a multi-award winning agency and every single website is custom built, and in under 2 weeks (unlike other agencies which take months to build a site) woocommerce makes this time longer as i have to re-style all of the account / cart / checkout pages to make them responsive – as well as working 5 hours a night unpaid overtime to get the site finished.
So the contact details section of the order confirmation screen is tabular then?
If you’re not going to change the way the cart is built, at least move the update cart button/coupon field outside of the table so it’s just the cart data. nothing should really be using tables if it’s not technically tabular.
The whole plugin just needs to be made more developer-friendly. It’s as if it’s built for complete beginners to use as-is on the StoreFront theme, with no consideration for custom builds
Incidentally, I’m not quite sure why you think that tables can’t be made responsive … if you’re running WordPress 4.3, pull up
/wp-admin/edit.php
and see what happens to the posts table (which is indeed still a<table>
element) at small screen widths.Yes tables can be made responsive if there isn’t much content in it and it’s pretty much the same length of content.
The edit.php page gets rid of literally everything on the page, something which you don’t want to do on a cart page.
Actually, it hides most of them, and then reveals it when a toggle link is clicked.
The point being, the ui can be manipulated easily via media queries. You can even prepend column headers per cell into
::before
pseudo-elements, as demonstrated here:https://css-tricks.com/examples/ResponsiveTables/responsive.php
I’m merely making the point that data in
<table>
elements — such as cart contents — can absolutely be made to display responsively with none of the markup changes that you seemed to be arguing were a necessity for using in a responsive theme.WooCommerce Core probably won’t start shipping advanced responsive markup for the shopping cart page, because they need to consider backcompat, and it could easily cause a tangled mess if any existing themes are already trying to do something else and core styles suddenly do something radically unexpected. And besides, that sort of responsive decision is something best left to the theme to dictate how it actually appears aesthetically.
Make sense?
Actually, it hides most of them, and then reveals it when a toggle link is clicked.
No it doesn’t – https://imgur.com/8H5KGxC That looks a mess! 390px wide. Any custom columns that are added don’t get removed
The point being, the ui can be manipulated easily via media queries. You can even prepend column headers per cell into ::before pseudo-elements, as demonstrated here:
https://css-tricks.com/examples/ResponsiveTables/responsive.php
I’ve done that before and you have to have at least 50% width on the pseudo element to make the title spacing worthwhile, which loses valuable space on the screen
I’ve tried to make my own plugin to override the WooCommerce trash that comes as default, but there’s that many ‘updates’ it makes it obsolete the minute I start it. – WHY was there 3 updates in less than a week when they could be bundled into 1 a month
Those updates are completely unrelated to your argument because no template files were changed. The template version is bumped in template files when changes occur.
It the fact that there’s so many updates that creating a plugin to replace the standard woocommerce files seems pointless as I never know when the templates will be updated.
variable.php
is a mess anyway so that needs updating urgently
- The topic ‘WooCommerce STILL using TABLES????’ is closed to new replies.