nimasdj — 2014-07-07T13:09:19-04:00 — #1
I have 4 simple html pages, in design, tables are used but I prefer div instead of table. Can anyone help me converting this from table to div?
technobear — 2014-07-07T13:27:03-04:00 — #2
I'm not sure what you're asking here.
I may be wrong, but as far as I know, the only way to convert from a table layout to a div layout is to strip out all the old HTML - or at least the table tags (<tr>, <td> etc.) - and restructure your page using semantic markup.
If there's an easier way than this, I wish I'd found it before now.
c_ankerstjerne — 2014-07-07T17:06:11-04:00 — #3
You could theoretically do this with a search-replace; <div id="td"> for <td>, <div id="tr"> for <tr>, and so on, and style the elements using display: table-cell, display: table-row, and other table equivalents. While this would remove the semantic markup, it would not really make much sense in terms of taking advantage of what you can do with CSS.
As you said, it would be much better to re-structure the HTML from scratch. If the page is built with tables, it will likely have other artefacts of poor page design anyway, which could be remedied at the same time.
felgall — 2014-07-07T17:30:10-04:00 — #4
There isn't one. At least not one that provides you with any actual benefit in making the change.
nimasdj — 2014-07-08T05:15:03-04:00 — #5
Better to move to div? Using tables are not recommended anymore nowadays?
peterorl — 2014-07-08T06:03:15-04:00 — #6
Using tables is old-fashioned and not recommended anymore. It is much easier and more gently to build div based site.
jm_roson_bravo — 2014-07-08T08:23:22-04:00 — #7
Table-based layout is old school.
Tables must be used just for presenting and organizing data, and not for layout a website or any of its contents.
Moreover, I guess that nimasdj must be talking about an old lady, full of deprecated elements and even scripts, outdated in terms of design, functionality and user experience, among other things.
You'd better forget it and design a new site from scratch.