|
||||||
| HTML Programming Forum discussion covering HTML, XHTML, DHTML and all flavors of HTML. Hypertext Markup Language is used to create websites. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
I've been suggested to use div tags instead of table tags to align objects on my webpage. As I understand div tags are only for setting styles though so how is it possible for me to align objects with div tags? For example, how could I create three columns and 2 rows with divs?
HTML Code:
<table border=0> <tr> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> |
| Sponsored Links |
|
|
|
|||||
|
Quote:
This site is a perfect example... Knoxville Life Church if you have firefox, disable the css when you get to this page, you will see that it is all div tags... Morale of the story is learn CSS Check out this section of the forum, it will answer your question: Div for positioning - HTML Help Central
__________________
Everything in Life can be solved with an 'If/Else' statement. Life is like one big try/catch statement, nested within a loop. -Will |
|
|||||
|
I would hope not. For the 7 years I've been a developer I've been told of the horrors of table-based layouts. I would like to believe that it is deprecated, CSS gives us that edge back. Or that one word: Flexibility.
__________________
Everything in Life can be solved with an 'If/Else' statement. Life is like one big try/catch statement, nested within a loop. -Will |
|
|||||
|
I don't think the table tag is deprecated yet. It's a fine solution for the purpose I mentioned in my last post; for showing different kinds of data. But I'll never use it for layout or anything else than showing data.
I don't think you can mix CSS into this discussion. CSS can be used on both table- and div tags. But you're right: CSS is way better, than putting the style right onto the tags (using the style attribute) I can't say I like the table tag over the div tags, because their purposes are different. But let's say it in this way: in 99% of my time developing websites, I'm using div tags over table tags. And I'm using CSS always, of course. |
| Sponsored Links |
|
|
|
|||||
|
@void
I agree with you on that. 99% of the time, it seems as if most people stay away from table driven websites. However, I am not indifferent to the idea. I have seen successfully written table-based layouts using CSS, as well as had to use them myself. I'm not saying its down right wrong. I just think there are better ways to code. Obviously the <table> tag has it's uses. I just am completely against using tables as a layout. Its such a horrible structure for your code. @archive02 Check this section out. It will answer your question.... Div for positioning - HTML Help Central
__________________
Everything in Life can be solved with an 'If/Else' statement. Life is like one big try/catch statement, nested within a loop. -Will Last edited by WillB; 09-06-2007 at 09:34 AM. Reason: Included Link |
|
|||||
|
I'm following your "philosophy" too. I don't think that table-layouts are worser than if you had been using divs for the work, but in my opinion it's more "right" to use table and div in the "right" way. Data showing with tables, and layouts and other stuff with divs.
I had a similar discussion on a danish forum, regarding the two PHP-functions, echo and print. I'm not saying that it's bad to use print in a stand-alone statement, but echo would be better. echo don't return anything, print does. What shall you do with the return-value from print? Nothing! The value is always the same (1) - so why not just use echo? I think it's better to use echo in this situation. It also lead to a post on my blog, if anyone is interested (though my english is pretty bad.) The last paragraph was slightly off-topic and irrelevant, but I think it fits in anyway. It kinda tells what I mean, in some way(?) |
|
|||
|
Thanks, that thread link helped a lot. Particularly the code at the bottom:
HTML Code:
<div id="menu"> <ul> <li><a href="page.htm">Link</a></li> <li><a href="page.htm">Link</a></li> <li><a href="page.htm">Link</a></li> <li><a href="page.htm">Link</a></li> <li><a href="page.htm">Link</a></li> </ul> </div> <div id="content"> blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah </div> Last edited by archive02; 09-07-2007 at 09:20 AM. |
|
|||||
|
Quote:
Although it didn't get as in depth. You should post your return value argument in that thread.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |