www.webdeveloper.com
Results 1 to 11 of 11

Thread: Replacing data table with a div-based design

  1. #1
    Join Date
    Jan 2018
    Posts
    2

    Replacing data table with a div-based design

    Good Afternoon, I have a one page html where on the bottom I have a data table, but for accessibility reasons I want to replace this data table with a div-based solution since I can't use tables for layouts.
    How would I achieve this? Zip file for reference has been attached.
    Thank you.

  2. #2
    Join Date
    Oct 2017
    Location
    Lithuania
    Posts
    71
    Well, I guess you only need to replace <td> elements with <div> elements and apply styles/formatting accordingly.

  3. #3
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    5,762
    For accessibility reasons?

    Why are you taking tabulated data thats in its proper element and want ot use DIV elements for? Accessibility is not the reason, tables do not affect accesibility, poor code does, so what is the reason or problem that is perceived here and chances are the issue is the failure to set tags or something.
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  4. #4
    Join Date
    Oct 2017
    Location
    Lithuania
    Posts
    71
    Well, maybe there's some background of the story... Such as - OP is doing this task as homework for programming class and his teacher wants to use old techniques (because he is not aware of a proper way). For example, about 15 years ago (or so) all the experts were advising to stop using tables in websites and use divs instead (because many sites used table-based layouts these days, I'm sure you remember that) because it's the proper way. While this statement was correct, some less tech-savvy persons took this advice too far and started dropping tables from HTML code completely, even when tables were actually needed. That might be the case here...
    Do you license your PHP scripts?

  5. #5
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    5,762
    First off, Links in Signatures are not allowed, the AUP of the forum states that you are allowed to put the URL in the place for it in your profile that then allows people to follow that link when they click on your name.

    Quote Originally Posted by phpmillion View Post
    Well, maybe there's some background of the story... Such as - OP is doing this task as homework for programming class and his teacher wants to use old techniques (because he is not aware of a proper way)
    Secondly, sorry but Tables is the original way to display tabulated data and unless I missed the memo, still is and not like some HTML tags that got culled in the HTML5 purge

    Using Divs is a poor choice, especially claiming accessibility needs, a device only hass to interpret the layout wrong and your data could end up mismatched to column headings, which is why a table is preferred as theirs no mistaking what item belongs to what column then.

    And homework or not, it is a very bad choice of training method, like I still see people with homework posts being taught javascript that is 20 years out of date.

    With a div, if a user wants to highlight a column of data to copy it, you would need a script just to work out what DIV's make up that colum because any programmer knows that your DIV has to have a unique ID to reference it. So the script also has to work on part selections and grouped selections and all these things happen automatically in the browser if data is stored in a table.

    As far as I can see, its what allot of citizens of a large country not that far in real terms of where I am... is a ... "no brainer."
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  6. #6
    Join Date
    Oct 2017
    Location
    Lithuania
    Posts
    71
    Quote Originally Posted by \\.\ View Post
    First off, Links in Signatures are not allowed, the AUP of the forum states that you are allowed to put the URL in the place for it in your profile that then allows people to follow that link when they click on your name.
    Thanks, changed that. However, would you mind pointing to the exact rule that doesn't allow links? I checked AUP at http://www.webdeveloper.com/aup.html and it has zero information on signatures. And if you search for word link or URL in whole text, you will only find that it's not allowed to post links to illegal content.

    Also, how it comes signature editor displays this? Allow Link BB Code Yes.

    Maybe I just missed some part in AUP? Thanks.
    Do you license your PHP scripts?

  7. #7
    Join Date
    Jan 2018
    Posts
    2
    The page I am talking about is https://library.syr.edu/departments/lc.php.. (the bottom table) I need to remove the table and use Bootstrap css instead... any ideas. ty

  8. #8
    Join Date
    Oct 2017
    Location
    Lithuania
    Posts
    71
    What's the exact reason you want to do it? You use table perfectly now, and table should always be used for such type of data. Hence, you need a very important reason if you want to move from good code to invalid code.
    Do you license your PHP scripts?

  9. #9
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    5,762
    Honestly, this to me seems like a merry go round, fact that someone wants to convert a table that is perfectly fine, in to a set of DIV's which will require lots of CSS to ensure control over layout is maintained... is like flogging a dead horse and a pointless task.

    @phpmillion, --
    You will not post advertisements, chain letters, pyramid schemes, or solicitations. You will not, furthermore, collect personal information for the purpose of sending any advertisements, chain letters, pyramid schemes, or solicitations through other means (email, messaging programs, etc.).
    and a link is an advert if it links to your site, its self promotion.

    Theres no issue having the site link in your profile where if set, as soon as your name is clicked, your URL should be available.
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

  10. #10
    Join Date
    Oct 2017
    Location
    Lithuania
    Posts
    71
    Alright, thanks. I guess we both understand "posts" and "signatures" in a completely different way. I usually think of post as a message which I type into post window, and I think of signature as... well, a signature, which is not a posting. Because, continuing with such an interpretation, link in user's profile is still "posting and/or "advertisement". Honestly, I have no idea how link in signature is an advertisement, and exactly the same link in other page (user page) becomes a non-advertisement. Oh well...
    Last edited by phpmillion; 01-08-2018 at 03:21 PM.
    Do you license your PHP scripts?

  11. #11
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    5,762
    We have a forum where threads are allowed because these are announcements, adverts for press releases and other type of promotion. The problem with links in threads are that none of them are vetted so you may end up following a link that has a payload at the end of it and the only people that get hurt are those people following the links and the sites reputation.
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center

"

"