PDA

View Full Version : With or without <div> tag


whl626
12-7-04, 08:18 PM
What is the difference with <div> and </div> tags wrapping up a table ?

<div align="justified">
<table>

</table>
</div>

As I deleted the <div> and </div> tags, it seems that nothing has changed to my page layout.

rainbore
12-8-04, 10:30 AM
The <DIV> element is a generic style or alignment container. It is used to provide general attributes to the elements contained within it. Its most commonly used to align the content with "left", "right", or "center", but it can be used to control other common attributes.

In this case, the author apparently intended to use <div align="justify"> to justify all of the text in the table, but since he used "justified", the tag had no effect because it was invalid and, therefore, ignored by browsers. Good luck!

B&T
12-8-04, 11:54 AM
tables were never really intended as a page formatting tool. that is what div and span and css is for. but many people (including me) do it because it is easy.