473,241 Members | 1,626 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

css and HTML layout

14
hello everyone
which one is better <div> or table for presentation and why please? thank you
Feb 26 '08 #1
10 1399
harshmaul
490 Expert 256MB
Hi Divs are better. DrHoward said it best in this forum...


http://www.thescripts.com/forum/thread774468.html
Feb 26 '08 #2
drhowarddrfine
7,435 Expert 4TB
Neither.

In ancient days, people used tables for layout because it was the only thing that worked, but tables were never designed for layout and, now that there are better ways, using tables for layout is stupid (see article titled that under Howtos at the top of this page).

A <div> element is one used to provide structure to a page and group common elements together. It is never an automatic decision to use one anywhere unless it's necessary. Some pages can contain none at all.

Laying out a web page is done with CSS and the normal flow of all html elements on a page. The question of which to use, tables or divs, is not one worth asking.
Feb 26 '08 #3
angkana
15
I have websit about Practical CSS Layout Tips, Tricks, & Techniques.


http://www.alistapart.com/articles/practicalcss/


Best Regards,
Angkana Jivaphaiboolsak
Feb 28 '08 #4
drhowarddrfine
7,435 Expert 4TB
The article is old but contains advice that is still true today. Thank you.
Feb 28 '08 #5
TheServant
1,168 Expert 1GB
From what I have read, you cannot replace tables with CSS? I use both on my site, and I have tried to get the same control over the placement of information (and backgrounds) using CSS instead of tables, but due to lack of experience I can't just yet.

I guess what I am asking is: Can I do the same with CSS as I can with tables, and will it be better?
Feb 29 '08 #6
drhowarddrfine
7,435 Expert 4TB
What you have to do is quit thinking in "tables mode". That's what I find most people trying to do is get CSS to act like a table when a table isn't necessary in the first place.

Anything tables can do with layout, CSS can do better.
Feb 29 '08 #7
TheServant
1,168 Expert 1GB
To get something like rounded borders, you need something like tables, <div>'s or even <p>'s I think. But this is really just replacing <td>'s with <div>'s? Really, the rest it fine, I think CSS is definately better with elastic and fluid page designs, I am only struggling with the look of my content borders.
Feb 29 '08 #8
drhowarddrfine
7,435 Expert 4TB
Tables are just pre-laid out grids you are confined to. divs are not. You don't have to use the borders that come with CSS. You can create your own with an image editor like Photoshop and use it as a background image or place them along the edges.
Feb 29 '08 #9
TheServant
1,168 Expert 1GB
Tables are just pre-laid out grids you are confined to. divs are not. You don't have to use the borders that come with CSS. You can create your own with an image editor like Photoshop and use it as a background image or place them along the edges.
I do use photoshop, but to make table backgrounds. I thought CSS only allowed you to change the top, bottom, left and right border? If this is true, then you can't really do customised corners? Or can you?
Mar 2 '08 #10
Markus
6,050 Expert 4TB
I do use photoshop, but to make table backgrounds. I thought CSS only allowed you to change the top, bottom, left and right border? If this is true, then you can't really do customised corners? Or can you?
Yes you can.

markus
Mar 2 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

71
by: tomy_baseo | last post by:
I'm new to HTML and want to learn the basics by learning to code by hand (with the assistance of an HTML editor to eliminate repetitive tasks). Can anyone recommend a good, basic HTML editor that's...
8
by: Millissa | last post by:
If someone can help me with examples of or info on how to create an advanced tables for the layout on my site, I would be very grateful! Thanks, M
72
by: Mel | last post by:
Are we going backwards ? (please excuse my spelling...) In my opinion an absolute YES ! Take a look at what we are doing ! we create TAGS, things like <H1> etc. and although there are tools...
3
by: Chris Kennedy | last post by:
I am fine designing .net apps by myself. For my company to start utilising ..net properly we need systems and approaches in place where we can integrate web designers designing the frontend and web...
13
by: David | last post by:
jumping on the train and with such a big jump that .Net is there is something I just find hard to believe... since the arrival of Web forms (<asp:xxx/>) - will I ever need to do manual HTML code...
26
by: gswork | last post by:
i hadn't designed a web page from the ground up for about 9 years, then i was asked to do one. I'd dabbled with html and vaigly kept up with some of the developments but other than that i've been...
59
by: phil-news-nospam | last post by:
In followups by Brian O'Connor (ironcorona) to other posts, he repeats the idea that using tables in CSS is not something that should be done because IE doesn't support it. Of course I'm not happy...
53
by: brave1979 | last post by:
Please check out my javascript library that allows you to create any layout for your web page, nested as deep as you like, adjusting to width and height of a browser window. You just describe it in...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
42
by: Santander | last post by:
how to decode HTML pages encoded like this: http://www.long2consulting.com/seeinaction2008/Simplicity_Beach_table/index.htm Is there script that will do this automatically and generate normal fully...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.