(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-17-24 11:23 PM
0 users currently in Programming.
Acmlm's Board - I3 Archive - Programming - Tables in CSS, hm?
  
User name:
Password:
Reply:
 
Options: - -
Quik-Attach:
Preview for more options

Max size 1.00 MB, types: png, gif, jpg, txt, zip, rar, tar, gz, 7z, ace, mp3, ogg, mid, ips, bz2, lzh, psd

UserPost
emcee
Posts: 695/867
Originally posted by Tarale
Its not considered a good idea to use tables because of the way Screen Readers and such will try to read them. CSS allows you to structure your stuff based on content, making it a lot easy for visually impaired users to browse your page.


Yes, if they're using very out of date screen reader software, they may have problems. But if they're using an out of date browser, they may have problems with divs. You can't really cover every situation, so I think its best to assume people have reasonably update software.

It's possible to optimize a web page for screen readers. But you can't just switch to all divs and assume that it will work. Using divs can actually make matters worse, especially when using floats.

Both approaches can be made to work just fine with screen readers. It's just a matter of testing.
Xkeeper
Posts: 4812/5653
To whoever said "div" tags create cleaner code, in most cases, you're pretty wrong. I've seen many instances where there were literally so many divs within divs I got a massive headache from trying to figure it out... especially since it was something that would easily be handled by a single table.

I could probably recreate the effect with some work, but at the moment I'm too lazy and the "spaced" border you have there would be fairly difficult to keep correctly.... but I'll see what I can do. :/
Tarale
Posts: 2419/2713
Originally posted by emcee
A lot of people try to avoid tables because they create a lot of extra code, and bury the content in HTML, but its really just preference. To me, tables are the most intuitive and logical way of structuring a page.


I would say it's more than just preference. But then I guess it depends if you care about accessibility or not.

Its not considered a good idea to use tables because of the way Screen Readers and such will try to read them. CSS allows you to structure your stuff based on content, making it a lot easy for visually impaired users to browse your page.

If you don't give a flying fuck about accessibility, then do whatever you like.

As for CSS support, it's quite well supported in most browsers, its just there are a few quirks that are likely to appear, particularly if you are not using valid code. As with all other code, it's a matter of testing in each browser.
Mega-Dog
Posts: 56/72
CSS Can cause problems in most browsers. I know that in FireFox it doesn't have complete CCS Support. Alot of times when developing also you cannot depend uppon the CSS since the page is developed in order...future refrerences to php and such cause layout to change...
HyperHacker
Posts: 4231/5072
Originally posted by emcee
A lot of people try to avoid tables because they create a lot of extra code, and bury the content in HTML, but its really just preference. To me, tables are the most intuitive and logical way of structuring a page.

Well the code isn't nice by any means... but throw a little PHP in and just about any code is going to be messy.


Anyway, if you float the div on the left to the left, and set the left margin on the box to the right to width of the left box, plus the gap you want between them, you should get the effect you're looking for.

So float would make it ignore the first box, placing the second where it would be? And then I use margins to position the second? I already did the job with tables but I might go back and re-do it with CSS if possible.

Also, is it possible for PHP to get the IP of the server it's running on, regardless of the client's address? IE I want to see the server's real IP (73.something.something) even when viewing the page from localhost. $_SERVER isn't much help:
[HTTP_HOST] => 127.0.0.1
[SERVER_NAME] => 127.0.0.1
[SERVER_ADDR] => 127.0.0.1
[REMOTE_ADDR] => 127.0.0.1
Metal Man88
Posts: 492/701
Bah, humbug. <table> will remain superior in my mind, and if browsers, try to drop support for it, I'll make an entire league just to stop them.

CSS just can't touch it, not without a disproportionate amount of effort, for people like me who've been doing it for years.
emcee
Posts: 692/867
It doesn't really have to be either CSS or tables, the too aren't really mutually exclusive. Tables are compliant with XHTML 1.0 Strict DTD. Certain attributes aren't though, but those can be specified through CSS.

A lot of people try to avoid tables because they create a lot of extra code, and bury the content in HTML, but its really just preference. To me, tables are the most intuitive and logical way of structuring a page.

Anyway, if you float the div on the left to the left, and set the left margin on the box to the right to width of the left box, plus the gap you want between them, you should get the effect you're looking for.
HyperHacker
Posts: 4210/5072
Everybody now seems to be obsessed with the idea "OMG don't use <table>, use CSS" when it comes to web design. So, a simple question. Here is an effect achieved using tables:



As you can see it has two boxes next to eachother. Now, how am I to recreate that in CSS without resorting to absolute positioning? It seems I have two options, using <span> :



or using <div> :



<span> fails because something just completely breaks, and because it appears to be impossible to actually define their width and height, IE they always just take the size of their contents. <div> fails because it's a block element, which means each one is followed by a line break. A quick Google search finds this page, which explains how to make an element in CSS act like a table cell or row or whatever. OK, but why make up my own table elements? I'm still using tables if I do it that way, may as well use <table>.

Also, I note that the table borders look nice while CSS "ridge" borders are fat and ugly.
Acmlm's Board - I3 Archive - Programming - Tables in CSS, hm?


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.003 seconds; used 358.41 kB (max 398.36 kB)