PDA

View Full Version : Tables vs. CSS


digitalnature
12/28/2005, 06:00
just wanted to know what are your opinions about these...

CSS is a little tricky to learn, but it has a few advantages over tables - decreases page size significantly, very SE friendly, redesigning & integrating it with scripts is easier. Also because not many people are experienced with CSS, prices for CSS-based designs are higher than the plain old html (some would not see this as an advantage, but I do :))

on the other hand, tables are very easy to learn and give you the possibility to build more complex designs (some things cannot be achieved with CSS).
some would say that tables were never made for design, but netscape's border="0" changed that...

Personally i would go for what suits the best, tho I prefer CSS over tables...

justin
12/28/2005, 09:36
I like css because in most cases you can have virtually the same design, with less code, making for faster loading.

hexadesigns
12/28/2005, 10:03
CSS just makes it easier to make your webpage W3C validated.

Consider the following:


<td valign="top" background="images/bg.gif" >&nbsp;</td>


Visually it will be ok on all browsers but, this will fail validation on W3C for a HTML 4.0 Transitional Loose dtd.
Now we can use CSS for the same and it will be W3C validated as well


<style>
.td1{ background:url(images/bg.gif); vertical-align: top;}
</style>

<td class="td1" >&nbsp;</td>

digitalnature
12/28/2005, 11:19
CSS just makes it easier to make your webpage W3C validated.

Consider the following:


<td valign="top" background="images/bg.gif" >&nbsp;</td>


Visually it will be ok on all browsers but, this will fail validation on W3C for a HTML 4.0 Transitional Loose dtd.
Now we can use CSS for the same and it will be W3C validated as well


or you can use
<td valign="top" style="background-image:url(images/bg.gif);">whatever</td>
and it validates :)

but this still uses tables :)
i should have said CSS-P vs tables.

something like

<div id="box"> some text </div>

and the css:

#box{
background-image: url(images/bg.gif);
padding: 8px 2px 8px 2px;
border-top: 1px solid #8C0000;
border-bottom: 1px solid #8C0000;
font: bold 11px/14px tahoma, arial, verdana, sans-serif;
color: #fff;
}

html pages are made of div tags instead of td, and they are positioned using css...

hexadesigns
12/28/2005, 11:45
Yes that makes sense. But personally, I like a mix of both just like the example I gave. :)

contrid
01/25/2006, 18:46
I was hoping that someone could give me some advice for centering CSS layered pages on all resolutions and browsers.

At the moment, I create my content pages, formatted with CSS and containing only layers with all text, objects, and other content inside the <div> tags.

Then I create one page, let's say 'index.html' which consists of 5 frames. top, bottom, left, right, and then for dynamically loading all other content pages MIDDLE frame. But unfortunately this has been giving me the problem of placing the scrollbar for the middle frame right next to the content. In other words, right next to the middle frame.

I am not really much of a coder, but I like it though, and learn very fast. Do any of you have some good, useful advice on this, or do you think that I am using the right handle?

Thanks. I hope to receive some feedback on this.

digitalnature
01/26/2006, 03:39
if you have a 760px container you can use something like:

<div style="width:760px; margin:0 auto">
Some text....
</div>

contrid
01/26/2006, 04:52
Digital Nature :

I do not understand what you are saying.

I am talking about layers, and centering them with frames from an external HTML and then preventing the annoying scrollbar on the side.

Thanks.

digitalnature
01/26/2006, 07:19
Digital Nature :

I do not understand what you are saying.

I am talking about layers, and centering them with frames from an external HTML and then preventing the annoying scrollbar on the side.

Thanks.

Did you say frames? Well, I wish you good look then

I'm very surprised that there are still people who use them :)
And more surprised to find out that you're a designer?

I advise you to switch to the (less older) table based layout :)
And maybe later, to the CSS based layouts...

A layer is a "absolute positioned" DIV tag - you can center it with CSS as I mentioned in the prev. post, but its postiton should be relative

contrid
01/26/2006, 07:29
I never use frames.

I had to adjust my coding a bit, for this one site, since I have to use frames in order to keep some of the info intact and other info dynamically changing.

I know what a layer is, and I can tell you so much more about layers.

<div id="layer" align="center"> Some Text </div>

And then in the HEAD of the document you will have the CSS specifications :

#layer
{
position:absolute;
z-index:1;
width:900px;
height:1200px;
color:#FFFFFF;
etc.
etc.
}

Why would you be so surprised that I am a designer. There is a difference between being a designer and a coder. Did you know? Or do you just sit behind your PC and play 'The Sims'???

digitalnature
01/26/2006, 07:40
actually i don't play computer games at all :)

sorry if I offended you in some way - it wasn't intentionally.

You can disable the scrollbar by setting the overflow hidden, or "scrolling" property for frames if I remember corectly.

contrid
01/26/2006, 07:47
When you use only CSS formatting, go ahead and try your page on different resolutions, window sizes, and most importantly all bowsers. The page won't always display correctly.

Anyways, no problem, I might have felt offended because of the fact that you said you were surprised that I am a designer. Yes, I am.

*The 'certified.shtml' still isn't working. I've been waiting about 15 minutes for it to load, but nothing is happening.

Thanks.

hexadesigns
01/26/2006, 13:00
When you use only CSS formatting, go ahead and try your page on different resolutions, window sizes, and most importantly all bowsers. The page won't always display correctly.

Thats why I mentioned always do a mix if you really want your pages to look the same on all browsers. :)

contrid
01/26/2006, 13:26
I mostly work with <div> tags, but then again when I use external XML documents for my pages to display content, I prefer to insert tables inside those <div> tags for the formatting. Makes it more organized and easier.

What comment do you people have about Frontpage and Publiser? NO, this is not a joke. Some people actually use those. But that is way out of my principles. Definately for lazy people. Don't you think?:)

IRN101
01/26/2006, 17:44
And as far as the topic goes I use a mix of both tables and CSS. Until the time comes when all browsers render things the same way at least.

Been designing sites for 10 years now. Back when tables were the only things. And the worst thing I've seen is frontpage. I hate frontpage. With a passion.

:)

digitalnature
01/26/2006, 20:10
When you use only CSS formatting, go ahead and try your page on different resolutions, window sizes, and most importantly all bowsers. The page won't always display correctly.

if it doesnt you can always fix it...
like i said, css is harder to learn

As for Ms Frontpage... :mad: