A reason to use tables instead of divs

Reply

Join Date: Dec 2008
Posts: 64
Reputation: cfajohnson is an unknown quantity at this point 
Solved Threads: 13
cfajohnson cfajohnson is offline Offline
Junior Poster in Training

Re: A reason to use tables instead of divs

 
0
  #11
Mar 9th, 2009
Originally Posted by pritaeas View Post
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,210
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 165
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: A reason to use tables instead of divs

 
0
  #12
Mar 9th, 2009
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.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 64
Reputation: cfajohnson is an unknown quantity at this point 
Solved Threads: 13
cfajohnson cfajohnson is offline Offline
Junior Poster in Training

Re: A reason to use tables instead of divs

 
0
  #13
Mar 10th, 2009
Originally Posted by MidiMagic View Post
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
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

Re: A reason to use tables instead of divs

 
0
  #14
Mar 13th, 2009
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:

  1. <block style="table-rows:2; table-cols:2">
  2. <block><inline>top left table cell!</inline></block>
  3. <block style="background-image:'some_image.png;'"/>
  4. <block><inline>omgz</inline></block>
  5. <block><inline>bottom right table cell</block>
  6. </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..
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,380
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 167
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: A reason to use tables instead of divs

 
0
  #15
Mar 13th, 2009
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
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
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 7
Reputation: boristhemoggy is an unknown quantity at this point 
Solved Threads: 0
boristhemoggy's Avatar
boristhemoggy boristhemoggy is offline Offline
Newbie Poster

Re: A reason to use tables instead of divs

 
0
  #16
Mar 13th, 2009
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.
Our brains haven't evolved to cope with the complexity of the world we've built!
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

Re: A reason to use tables instead of divs

 
0
  #17
Mar 13th, 2009
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.
Plato forgot the nullahedron..
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 64
Reputation: cfajohnson is an unknown quantity at this point 
Solved Threads: 13
cfajohnson cfajohnson is offline Offline
Junior Poster in Training

Re: A reason to use tables instead of divs

 
0
  #18
Mar 13th, 2009
Originally Posted by MattEvans View Post
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,210
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 165
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: A reason to use tables instead of divs

 
0
  #19
Mar 19th, 2009
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).
Last edited by MidiMagic; Mar 19th, 2009 at 4:49 pm.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,210
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 165
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: A reason to use tables instead of divs

 
0
  #20
Mar 19th, 2009
Originally Posted by cfajohnson View Post
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.
Yes, so am I.
How is this achieved? When you shrink the browser window, or use a different screen resolution, the divs won't stay put.

I'm talking about divs that don't go crazy when you put a list or a table inside.
Me, too.
How is this achieved? Whenever I try it, the list won't stay together, or the table pokes outside the div.

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.
They certainly do not respond to the width and height styles correctly. I had divs inside of table cells to further format the contents. They never would expand beyond the size of the text they contained.

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.

I'm talking about structures that don't take several hours of tweaking to make them work.
Agreed: <DIV>
It won't work. Every time I try to make what seems to be a straightforward structure from div tags, something goes blooey in the browser. and it falls apart: Either stuff leaks out of the div, or the object contained in the div is put elsewhere.

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.

I'm talking about being able to use the same methods and always getting the same results.
Agreed: <DIV>
It doesn't work.

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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for HTML and CSS
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC