943,724 Members | Top Members by Rank

Ad:
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Mar 9th, 2009
0

Re: A reason to use tables instead of divs

Click to Expand / Collapse  Quote originally posted by pritaeas ...
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.
Reputation Points: 25
Solved Threads: 23
Junior Poster
cfajohnson is offline Offline
193 posts
since Dec 2008
Mar 9th, 2009
0

Re: A reason to use tables instead of divs

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.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007
Mar 10th, 2009
0

Re: A reason to use tables instead of divs

Click to Expand / Collapse  Quote 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.
Quote ...
I'm talking about divs that don't go crazy when you put a list or a table inside.

Me, too.
Quote ...
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.
Quote ...
I'm talking about structures that don't take several hours of tweaking to make them work.

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

Agreed: <DIV>
Reputation Points: 25
Solved Threads: 23
Junior Poster
cfajohnson is offline Offline
193 posts
since Dec 2008
Mar 13th, 2009
0

Re: A reason to use tables instead of divs

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:

XML Syntax (Toggle Plain Text)
  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?
Moderator
Featured Poster
Reputation Points: 522
Solved Threads: 64
Veteran Poster
MattEvans is offline Offline
1,091 posts
since Jul 2006
Mar 13th, 2009
0

Re: A reason to use tables instead of divs

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
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009
Mar 13th, 2009
0

Re: A reason to use tables instead of divs

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
boristhemoggy is offline Offline
7 posts
since May 2006
Mar 13th, 2009
0

Re: A reason to use tables instead of divs

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.
Moderator
Featured Poster
Reputation Points: 522
Solved Threads: 64
Veteran Poster
MattEvans is offline Offline
1,091 posts
since Jul 2006
Mar 13th, 2009
0

Re: A reason to use tables instead of divs

Click to Expand / Collapse  Quote originally posted by MattEvans ...
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.
Quote ...
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.
Reputation Points: 25
Solved Threads: 23
Junior Poster
cfajohnson is offline Offline
193 posts
since Dec 2008
Mar 19th, 2009
0

Re: A reason to use tables instead of divs

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.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007
Mar 19th, 2009
0

Re: A reason to use tables instead of divs

Click to Expand / Collapse  Quote originally posted by cfajohnson ...
Quote ...
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.

Quote ...
Quote ...
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.

Quote ...
Quote ...
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.

Quote ...
Quote ...
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.

Quote ...
Quote ...
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.
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Attempting 2.0 Design
Next Thread in HTML and CSS Forum Timeline: Style Issue While Becoming Complient





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC