| | |
A reason to use tables instead of divs
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Dec 2008
Posts: 64
Reputation:
Solved Threads: 13
•
•
•
•
This would be the CSS standard... ;-)
Unfortunately, because of the ever changing way the browsers implement the standard, this would be very hard to do. If they would all comply it would be easy.
Almost all browsers (including IE since 6) do comply with most of the standards. It is not hard to write CSS that works in all browsers. It means avoiding some things that IE doesn't do correctly, and occasionally letting IE produce a less-than-optimal (but still usable) page.
Chris F.A. Johnson
http://cfajohnson.com
http://cfajohnson.com
I'm talking about using div to make a page that doesn't fall apart if someone (or the browser) looks at it wrong.
I'm talking about divs that don't go crazy when you put a list or a table inside.
I'm talking about divs that can be made to expand to fill their containers without using absolute measures.
I'm talking about structures that don't take several hours of tweaking to make them work.
I'm talking about being able to use the same methods and always getting the same results.
I'm talking about divs that don't go crazy when you put a list or a table inside.
I'm talking about divs that can be made to expand to fill their containers without using absolute measures.
I'm talking about structures that don't take several hours of tweaking to make them work.
I'm talking about being able to use the same methods and always getting the same results.
Daylight-saving time uses more gasoline
•
•
Join Date: Dec 2008
Posts: 64
Reputation:
Solved Threads: 13
•
•
•
•
I'm talking about using div to make a page that doesn't fall apart if someone (or the browser) looks at it wrong.
Yes, so am I.
•
•
•
•
I'm talking about divs that don't go crazy when you put a list or a table inside.
Me, too.
•
•
•
•
I'm talking about divs that can be made to expand to fill their containers without using absolute measures.
If you use absolute measures they cannot expand.
•
•
•
•
I'm talking about structures that don't take several hours of tweaking to make them work.
Agreed: <DIV>
•
•
•
•
I'm talking about being able to use the same methods and always getting the same results.
Agreed: <DIV>
Chris F.A. Johnson
http://cfajohnson.com
http://cfajohnson.com
Why do you want to never use tables and only use divs?
(BTW: no-one ever answers this with a decent -- rarely even an accurate -- answer. infact, most people go and answer a completely different question, and if you dont have an answer to this question because it doesn't apply to you, then contending the original points on whatever grounds is arguing at cross-purposes: because I don't believe that MidiMagic is saying only use tables)
In every other part of software development, heck, in almost every other field, period: people use the tool that best fits the job, and rarely think twice about it. there's no for-loop appreciators club, or cult of the saucepan.. although, come to think of it, there probably is...
the occasional "goto" never really harmed anyone; and likewise, the occasional table is sometimes both 'justifiable' and the 'best choice'.
saucepans work well as as long as you dont try and use them as for loops; divs work well and are totally 'easy': as long as you don't try and make a table-like layout with them. if you do, then you suffer from a lack of one of the following information bridges:
- the one that keeps the column widths the same
- the one that keeps the row heights the same
you can hack in one of those, but not both. it should be evident from the specification of HTML and CSS that you can't.
there's a reason why most (perhaps all?) GUI toolkits have some kind of low-level 'table layout'. if it was possible to compose that functionality via other means, there'd be no need for that low level layout.
..........
but anyway, IMHO, the next HTML should get rid of all of the elements (and their silly names ), create two new elements 'block' and 'inline', and have everything specified by CSS:
solve everyone's problems, huh? if you care to, you could even implement this hot new language yourself (albeit statically) using some clever XSLT.
something for the weekend?
(BTW: no-one ever answers this with a decent -- rarely even an accurate -- answer. infact, most people go and answer a completely different question, and if you dont have an answer to this question because it doesn't apply to you, then contending the original points on whatever grounds is arguing at cross-purposes: because I don't believe that MidiMagic is saying only use tables)
In every other part of software development, heck, in almost every other field, period: people use the tool that best fits the job, and rarely think twice about it. there's no for-loop appreciators club, or cult of the saucepan.. although, come to think of it, there probably is...
the occasional "goto" never really harmed anyone; and likewise, the occasional table is sometimes both 'justifiable' and the 'best choice'.
saucepans work well as as long as you dont try and use them as for loops; divs work well and are totally 'easy': as long as you don't try and make a table-like layout with them. if you do, then you suffer from a lack of one of the following information bridges:
- the one that keeps the column widths the same
- the one that keeps the row heights the same
you can hack in one of those, but not both. it should be evident from the specification of HTML and CSS that you can't.
there's a reason why most (perhaps all?) GUI toolkits have some kind of low-level 'table layout'. if it was possible to compose that functionality via other means, there'd be no need for that low level layout.
..........
but anyway, IMHO, the next HTML should get rid of all of the elements (and their silly names ), create two new elements 'block' and 'inline', and have everything specified by CSS:
XML Syntax (Toggle Plain Text)
<block style="table-rows:2; table-cols:2"> <block><inline>top left table cell!</inline></block> <block style="background-image:'some_image.png;'"/> <block><inline>omgz</inline></block> <block><inline>bottom right table cell</block> </block>
solve everyone's problems, huh? if you care to, you could even implement this hot new language yourself (albeit statically) using some clever XSLT.
something for the weekend?
Plato forgot the nullahedron..
Tables are perfect for tabular data
You can create a javascript to sort a table and view the info any way you like
tables for layout just for spacing, not so good
You can create a javascript to sort a table and view the info any way you like
tables for layout just for spacing, not so good
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
I kind of agree with midimagic even though I don't want to.
Tables were meant to display content: div's were designed to control layout. 2 separate things but not mutually exclusive.
Firstly, I'm sick of hearing that 'change is good'. Who decided that while I slept? Consistency is good, having the time to get really good at something is good, being balanced and feeling secure is good.
Having said that, we are all remember right at the forefront of the internet. It really hasn't been around that long, (The popular interweb I'm talking about) therefore there's bound to be change to some degree until it's decided just what it is. Who says WC3 is correct and MS aren't?
Anyway does it all really matter?
I have created some sites in basic HTML, I've done some in ASP, I've laid them out in tables and CSS, div's and CSS, tables and html and used includes where appropriate and whatever else way I saw fit for each site.
They're all tools to use and I use whichever one of them gets the job done in the same way I sometimes belt something with my heavy pliers, because I can't be bothered to go get the hammer. If the result is how I want it who cares how I achieved it?
If you're going to have standards, then everyone must adhere to them, including those arrogant browser writers. Otherwise, I'll do the best job I can using the most appropriate tools for the job.
Tables were meant to display content: div's were designed to control layout. 2 separate things but not mutually exclusive.
Firstly, I'm sick of hearing that 'change is good'. Who decided that while I slept? Consistency is good, having the time to get really good at something is good, being balanced and feeling secure is good.
Having said that, we are all remember right at the forefront of the internet. It really hasn't been around that long, (The popular interweb I'm talking about) therefore there's bound to be change to some degree until it's decided just what it is. Who says WC3 is correct and MS aren't?
Anyway does it all really matter?
I have created some sites in basic HTML, I've done some in ASP, I've laid them out in tables and CSS, div's and CSS, tables and html and used includes where appropriate and whatever else way I saw fit for each site.
They're all tools to use and I use whichever one of them gets the job done in the same way I sometimes belt something with my heavy pliers, because I can't be bothered to go get the hammer. If the result is how I want it who cares how I achieved it?
If you're going to have standards, then everyone must adhere to them, including those arrogant browser writers. Otherwise, I'll do the best job I can using the most appropriate tools for the job.
Our brains haven't evolved to cope with the complexity of the world we've built!
I agree that using tables solely for spacing probably isn't the best way to go about things.
But, I firmly believe that using tables for creating robust related columns and rows of any type is 'the right thing to do' (i.e., not just tables of raw, sortable/headed, data): mostly because there is a lack of a viable alternative.
Obviously the 'ideal' is to have one HTML nodeset look completely different and still function for it's original purpose simply by flipping a style... but that only really works in specific, quite simple settings.
But, I firmly believe that using tables for creating robust related columns and rows of any type is 'the right thing to do' (i.e., not just tables of raw, sortable/headed, data): mostly because there is a lack of a viable alternative.
Obviously the 'ideal' is to have one HTML nodeset look completely different and still function for it's original purpose simply by flipping a style... but that only really works in specific, quite simple settings.
Plato forgot the nullahedron..
•
•
Join Date: Dec 2008
Posts: 64
Reputation:
Solved Threads: 13
•
•
•
•
But, I firmly believe that using tables for creating robust related columns and rows of any type is 'the right thing to do' (i.e., not just tables of raw, sortable/headed, data): mostly because there is a lack of a viable alternative.
Of course! That's what tables are for.
•
•
•
•
Obviously the 'ideal' is to have one HTML nodeset look completely different and still function for it's original purpose simply by flipping a style... but that only really works in specific, quite simple settings.
In fact, it can work with fairly complicated layouts.
Chris F.A. Johnson
http://cfajohnson.com
http://cfajohnson.com
Then maybe we are looking for the wrong solution.
The reason the W3C wants tables kept to tabular data is that web readers for the blind announce the row and column of every table cell.
So is there a way to put a style in to get the web reader to shut up about the rows and columns when the table is used to keep a layout from falling apart?
Alternately, we need dtr and dtd tags that behave like the tr and td tags of a table, to get the div ducks all in a row (or column).
The reason the W3C wants tables kept to tabular data is that web readers for the blind announce the row and column of every table cell.
So is there a way to put a style in to get the web reader to shut up about the rows and columns when the table is used to keep a layout from falling apart?
Alternately, we need dtr and dtd tags that behave like the tr and td tags of a table, to get the div ducks all in a row (or column).
Last edited by MidiMagic; Mar 19th, 2009 at 4:49 pm.
Daylight-saving time uses more gasoline
•
•
•
•
Yes, so am I.••••Originally Posted by MidiMagic
I'm talking about using div to make a page that doesn't fall apart if someone (or the browser) looks at it wrong.
•
•
•
•
Me, too.••••I'm talking about divs that don't go crazy when you put a list or a table inside.
•
•
•
•
If you use absolute measures they cannot expand.••••I'm talking about divs that can be made to expand to fill their containers without using absolute measures.
I had to use absolute measures
{height: .75in; width: 1.5in;} to get the div to expand to the size of the containing table cell. 100% height and width did not work.The table cells were of fixed height because one cell in each row contained an image.
•
•
•
•
Agreed: <DIV>••••I'm talking about structures that don't take several hours of tweaking to make them work.
I made a simple div just to put a colored box with a border around some text and a table. The table refused to stay inside the div. Either the div got very small and stayed above the table containing the text, or the table stuck out of the div on one side or the bottom. This was WITHOUT any size styles, other than that the table was to be 50 percent wide and aligned right. The div behaved as if only the text was inside it. The code validated with W3C.
It worked right if I substituted a one-cell table for the div, applying the same styles to the table.
•
•
•
•
Agreed: <DIV>••••I'm talking about being able to use the same methods and always getting the same results.
I had a nice two-column div structure that stayed together nicely under all circumstances. Then, just to add emphasis, I replaced an ordered list with a small table. I made sure the table would fit into the containing div that used to contain the list. Nothing else changed. But the div structure fell apart.
Daylight-saving time uses more gasoline
![]() |
Similar Threads
- How to make this layout using tableless Divs (HTML and CSS)
- General rules when working with divs and css. (HTML and CSS)
- css not working in IE (HTML and CSS)
- Why do people wish for tableless with CSS? (HTML and CSS)
- Align floated images in center of page with CSS (HTML and CSS)
- html template help (HTML and CSS)
Other Threads in the HTML and CSS Forum
- Previous Thread: Attempting 2.0 Design
- Next Thread: Style Issue While Becoming Complient
| Thread Tools | Search this Thread |
Tag cloud for HTML and CSS
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash font fonts form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization perl pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7 xml xsl






