PDA

View Full Version : سوال: فرق div با table



webdesignergorgani
شنبه 29 فروردین 1388, 07:51 صبح
سلام
ميخواستم فرق div با table رو در كد نويسي بدونم.

emad_67
شنبه 29 فروردین 1388, 12:11 عصر
Tables were meant to make columns of tabular data. they are very controlled and linear.

Div on the other hand are free. You can put anything anywhere in that Div, no horizontal or vertical columns to limit your positioning. So a table is like a tool box with all those little compartments that cannot change size, you can only re-arange them. A Div is like a empty box, you can move any element anywhere and resize it as you wish, no limitations. Place one elemet at exactly92 pixels from the wall if you like.

So in your body you create a outer Div, the rest of the web site is built in that. Your banner is in one Div, menu is another Div, different boxes are different divs and content is a seperate div. All these divs can be placed individually anywhere on the web page.

The link you give is a perfect design for this.

Other advantages:


When you name each Div seperatly with a ID for the CSS, that ID can be used as a target for scripts or internal links as well.
When you take away the CSS (important for those with disabilities) it degrades into a simple vertical text document, where tables will still have a layout that can make the reading of the page by screenreaders difficult to understand as it skips in a unlogical manner through the page.
Those with disabilities can change the look of the site more effectively to meet their needs
By using Divs, you can redefine the Div names with new positions, colors etc and in that manner completely change your web site design by loading a different CSS without bothering to change the source code. Either create different designs for those with disabilities or maybe just a special Valentines, Christmas, Halloween design for a few days...



Divs are the smart way to design web sites and make maintenance alot easier
http://www.killersites.com/mvnforum/mvnforum/viewthread?thread=3796

میـلاد
شنبه 29 فروردین 1388, 12:27 عصر
یکی از مزیت های اصلیش زمان لود شدن هست که div سریعتر لود میشه.

benyaminj
یک شنبه 30 فروردین 1388, 01:36 صبح
چجوری بايد آدرس يه عکس رو داخل يه table يا div گذاشت؟

alireza_farshid
پنج شنبه 03 اردیبهشت 1388, 09:40 صبح
چجوری بايد آدرس يه عکس رو داخل يه table يا div گذاشت؟

دوست عزیز کافیه تگ مربوط به عکس رو بین تگ شروع و پایان table و یا div بذاری مثل این

<div><img src=[image Address]/></div>

rasoolgh1
جمعه 11 اردیبهشت 1388, 23:41 عصر
با سلام :
1.دوست عزیز اولا با div اصولا لایه بندی و می کنند و table همچن خاصیتی نداره
درباره سرعت لودش نمیدونم
2.اگر برای طراحی اصلی سایت هست دیگه از تگ img استفاده نمیشه
به صورت زیره.

<div id="image" style="background:url(name pic);">
</div>