Jump to content

Why not <table>


midnite

Recommended Posts

It's called the "position property" btw, but that's just a detail :) .For all presentations, you shold use CSS. CSS, with the position property or by the usage of floats, margins, paddings and others can achieve amazing results that can make a 1KB page look like what would take 6KBs (at least) with a table based layout.For centering an element horizontally, you can use "margin:0 auto;" on the element you need to center. If you want to center only the contents, rather then the element iself, you can use "text-align:center;".Read more on CSS on the W3Schools' CSS tutorial.
I found that <div> isn't a replacement for <table>. Specifically, I have a four column table I'm trying to replace with divs. The problem is that when the text word-wraps, it throws off the entire layout. Suddenly, stuff is all over the line. You can't see it (firewall), but I could post an image of the mess.
Link to comment
Share on other sites

I found that <div> isn't a replacement for <table>. Specifically, I have a four column table I'm trying to replace with divs. The problem is that when the text word-wraps, it throws off the entire layout. Suddenly, stuff is all over the line. You can't see it (firewall), but I could post an image of the mess.
Who ever said divs are a replacement for tables? Tables still have their place. It's just that they are not used for what they are supposed to do. Read my very fist post:
Tables should only be used for tabular data.
They are not deprecated, and they are not going to be. They still have their purpose. If you need to use a table for a representation of tabular data, use a table for representation of the tabular data.
Link to comment
Share on other sites

Sorry for the confusion. I didn't mean to imply any statement from you.What I was talking about was using the <div> tag to replace the <table> when that table is being used solely for the purpose of positioning elements. It seems to work OK for two columns, but I sure can't get it to work for 4 columns.

Link to comment
Share on other sites

Sorry for the confusion. I didn't mean to imply any statement from you.What I was talking about was using the <div> tag to replace the <table> when that table is being used solely for the purpose of positioning elements. It seems to work OK for two columns, but I sure can't get it to work for 4 columns.
Well... yes. It's hard to do such layouts. At least when taking into account that IE doesn't yet support CSS display:table; properties.If you were making non-IE only site, then this would be damn easy.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...