← HTML + CSS

Tables vs Divs

Lida 17331 vezes

Offline

João Godinho 
Membro
Mensagens 1755 Gostos 2
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Bem eu faço os meus trabalhos em tables, mas devo passar a usar divs?
Offline

Diogo Pinto 
Administrador
Mensagens 4400 Gostos 371
Feedback +4

Troféus totais: 37
Trófeus: (Ver todos)
Avatar Search Level 6 Linux User Mobile User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes

Claro que sim... Sem dúvida nenhuma. As tabelas pertencem ao século passado ;)
Offline

AnaMartelo 
Administrador
Mensagens 2071 Gostos 25
Feedback +28

Troféus totais: 29
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Durante muito tempo tb trabalhei (as pouquissimas coisas que fiz) em tabs, mas agora que frequentei um curso de CSS que nunca mais usei, divs é o melhor mesmo!
Offline

João Godinho 
Membro
Mensagens 1755 Gostos 2
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Claro que sim... Sem dúvida nenhuma. As tabelas pertencem ao século passado ;)
:S
Há certas coisas que não sei fazer com divs, vai ser dificil mudar. :S
Offline

Nuno 
Administrador
Mensagens 7780 Gostos 216
Feedback +2

Troféus totais: 42
Trófeus: (Ver todos)
100 Poll Votes Level 7 Search Mobile User Level 6 Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes

Tables? Isso ainda existe...

http://960.gs/
Offline

André Freitas 
Membro
Mensagens 941 Gostos 16
Troféus totais: 29
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

O uso de DIVS para layout do site é muito importante, pois em termos de SEO facilita os bots a ler melhor conteúdo e poupas imenso em código HTML. Quando digo imenso é mesmo imenso!

As Tabelas só devem ser usadas quando necessárias em termos de conteúdo.

Podes ir dando uma olhadela por aqui http://www.w3schools.com/css/default.asp

Começa a fazer pequenos templates para praticares os posicionamentos e depois é só continuar a aprender. :)
Offline

João Godinho 
Membro
Mensagens 1755 Gostos 2
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Vejam este site: www.PormenorVirtual.com
Aquelas 3 "boxes, não sei fazer com div's, devo tentar usar div's ou fazer em tables?
Offline

Nuno 
Administrador
Mensagens 7780 Gostos 216
Feedback +2

Troféus totais: 42
Trófeus: (Ver todos)
100 Poll Votes Level 7 Search Mobile User Level 6 Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes

Aquilo é muito simples, algo do género

div1 {
width:33%;
float:left
}
div2 {
width:33%;
float:left
}
div3 {
width:33%;
float:left
}
Offline

João Godinho 
Membro
Mensagens 1755 Gostos 2
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

e como fico com aquele espaço?
Offline

André Freitas 
Membro
Mensagens 941 Gostos 16
Troféus totais: 29
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Ou algo do género:
.caixa{
     width: 290px;
     height: 223px;
     background: #CCCCCC;
     float: left;
    margin-right: 2px; /* Para dar espaçamento */
}

HTML:
<div class="caixa">Conteúdo 123</div> <div class="caixa">Conteúdo 123</div> <div class="caixa">Conteúdo 123</div>

Nota: Mediante o que vês vais dando uns ajustes.

Para centrá-las podias usar um contentor que era uma nova div com margin: 0 auto; e dimensões definidas.
Offline

João Godinho 
Membro
Mensagens 1755 Gostos 2
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Obrigado.
Offline

João Godinho 
Membro
Mensagens 1755 Gostos 2
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Vou codar um site com div's, vou tirar aqui as minha dúvidadas pode ser?
Offline

João Godinho 
Membro
Mensagens 1755 Gostos 2
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Como se alinha uma div no centro da página?
Offline

Nuno 
Administrador
Mensagens 7780 Gostos 216
Feedback +2

Troféus totais: 42
Trófeus: (Ver todos)
100 Poll Votes Level 7 Search Mobile User Level 6 Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes

Como se alinha uma div no centro da página?

margin: 0 auto;
Offline

Diogo Pinto 
Administrador
Mensagens 4400 Gostos 371
Feedback +4

Troféus totais: 37
Trófeus: (Ver todos)
Avatar Search Level 6 Linux User Mobile User Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes

joaogodinho, vamos lá ter atenção aos posts duplicados! Exite um botão chamado "Modificar", é mesmo espectacular...

crias um container e no body dás um text-align: center;

Ou como o exit disse...