Existe vários tipos de alinhamento para o texto
escrito nas células de uma tabela, e vamos ver um por um.
Para
isso usamos dois atributos com seus valores, são eles:
<TD ALIGN> com seus valores= LEFT, RIGHT e CENTER.
<TD VALIGN> com seus valores= TOP, BOTTOM e MIDDLE.
<TD VALIGN> com seus valores= TOP, BOTTOM e MIDDLE.
Exemplo
na sintexe:
<html>
<head>
<title> ajustando o texto da
tabela</title>
</head>
<body>
<table width="400"
border="1"height="200"bordercolor="red">
<tr>
<td width="250" bgcolor="yellow"> <font
face="arial" size="3">
alinhamento horizontal padrão</font>
</td>
<td width="220">
<font face="arial" size="2">
<b> align=left-a esquerda</b> </font>
</td>
<td width="220" align="center">
<font face="arial" size="2">
<b> align=center</b> </font>
</td>
<td width="220" align="right">
<font face="arial" size="2">
<b> align=right-a direita</b> </font>
</td>
</tr>
<tr>
<td width="250"> <font
face="arial" size="3">
alinhamento vertical padrão</font>
</td>
<td width="220" valign="top">
<font face="arial" size="2"> <b>
valign=top</b> </font>
</td>
<td width="220" valign="middle"> <font
face="arial" size="2">
<b> valign=middle</b> </font>
</td>
<td width="220" valign="bottom">
<font face="arial" size="2">
<b> valign=bottom</b> </font>
</td>
</tr>
</table>
</body>
</html>
Veja como ficou visualizada num navegador:
Essa tabela
mostra os possíveis alinhamentos de um texto, dentro de uma célula de uma
tabela.
E nesta tabela foi especificado o valor dos atributos de altura e
largura (<table width="400" height="200">).
Veja
esta mesma tabela sem o valor desses atributos de largura e altura.
Nessa tabela se ignorou os valores que definem a largura e altura (<table width= height= >).
Vamos ver agora como fazer um
Alinhamento vertical e
horizontal de um texto de uma tabela.
Nenhum comentário:
Postar um comentário