You are on page 1of 15

Tīmekļa lapu veidošana

4. HTML pamati
Tabulas
Atkārtojuma jautājumi
Pareizi veidota saite uz dokumentu lapa1.htm:
• <a href>lapa1.htm</a>
• <a=lapa1.htm>Saite</a>
• <a href=“lapa1.htm”>Saite</a>
• <a=href lapa1.htm>Saite</a>
Atkārtojuma jautājumi
Pareizi veidota saite uz ārēju adresi, kura
atveras jaunā logā:
• <a href=“http://www.lapa.lv/”
target=_blank”>Saite</a>
• <a href=blank=“http://www.lapa.lv/”>Saite</a>
• <a href=blank>http://www.lapa.lv/</a>
• <a=http://www.lapa.lv _blank></a>
Atkārtojuma jautājumi
HTML dokumenta nosaukumu raksta tagā:
• <html>
• <name>
• <title>
• <head>
Atkārtojuma jautājumi
Pareizs sakārtots saraksts:
• <ol><li>1</li><li>2</li><li>3</li></ol>
• <ul><li>1</li><li>2</li><li>3</li></ul>
• <ol>1<br>2<br>3<br></ol>
• <ol>1</ol><ol>2</ol><ol>3</ol>
Atkārtojuma jautājumi
Pareizi ievietots attēls:
• <img=“bilde.jpg>Attēls</img>
• <img source=“bilde.jpg”>
• <img src=“c:\My Pictures\bilde.jpg”>
• <img src=“bilde.jpg”>
Tabulas tagi <table> <tr> <td>
• Pamata tags <table> <table border="1">
• Tabula tiek dalīta rindās <tr>
<tr> <td>1. rinda, 1. šūna</td>
• Katra rinda datu šūnās <td>1. rinda, 2. šūna</td>
<td> </tr>
• Katra šūna var saturēt <tr>
tos pašus elementus, ko <td>2. rinda, 1. šūna</td>
viss html dokuments <td>2. rinda, 2. šūna</td>
</tr>
</table>
Tabulas tagi <table> <tr> <td>
<table border="1">
<tr>
<td>1. rinda, 1. šūna</td>
<td>1. rinda, 2. šūna</td>
</tr>
<tr>
<td>2. rinda, 1. šūna</td>
<td>2. rinda, 2. šūna</td>
</tr>
</table>
Tabulas virsraksts <th>
<table border="1">
<tr>
<th>Virsraksts</th>
<th>Cits virsraksts</th>
</tr>
<tr>
<td>1. rinda, 1. šūna</td> <td>1.
rinda, 2. šūna</td> </tr>
<tr>
<td>2. rinda, 1. šūna</td> <td>2.
rinda, 2. šūna</td> </tr>
</table>
Tabulas nosaukums <caption>
<table border="1">
<caption>Nosaukums</caption>
<tr>
<th>Virsraksts</th>
<th>Cits virsraksts</th>
</tr>
<tr>
<td>1. rinda, 1. šūna</td> <td>1.
rinda, 2. šūna</td> </tr>
<tr>
<td>2. rinda, 1. šūna</td> <td>2.
rinda, 2. šūna</td> </tr>
</table>
Satura atstatums no šūnas robežas
cellpadding
<table border=“1” cellpadding="10">
<caption>Nosaukums</caption>
<tr>
<th>Virsraksts</th>
<th>Cits virsraksts</th>
</tr>
<tr>
<td>1. rinda, 1. šūna</td> <td>1.
rinda, 2. šūna</td> </tr>
<tr>
<td>2. rinda, 1. šūna</td> <td>2.
rinda, 2. šūna</td> </tr>
</table>
Atstatums starp šūnām cellspacing
<table border=“1” cellspacing="10">
<caption>Nosaukums</caption>
<tr>
<th>Virsraksts</th>
<th>Cits virsraksts</th>
</tr>
<tr>
<td>1. rinda, 1. šūna</td> <td>1.
rinda, 2. šūna</td> </tr>
<tr>
<td>2. rinda, 1. šūna</td> <td>2.
rinda, 2. šūna</td> </tr>
</table>
Šūnu apvienošana horizontāli <colspan>
<table border="1">
<caption>Nosaukums</caption>
<tr>
<th>Virsraksts</th>
<th>Cits virsraksts</th>
</tr>
<tr>
<td colspan="2">
Šūnas apvienotas horizontāli
</td>
</tr>
<td>1. rinda, 1. šūna
[..]
</table>
Šūnu apvienošana vertikāli <rowspan>
<tr>
<th>Virsraksts</th>
<th colspan="2">Cits virsraksts</th>
</tr>
<tr>
<td rowspan="2“>Šūnas apvienotas
vertikāli</td>
<td>1. rinda, 1. šūna</td>
<td>1. rinda, 2. šūna</td>
</tr>
<tr>
<td>2. rinda, 1. šūna</td>
<td>2. rinda, 2. šūna</td> </tr>
Tagu un atribūtu kopsavilkums
• <table> - tabula
• <tr> - tabulas rinda
• <td> - tabulas šūna (katrā rindā)
• <th> - virsraksti tabulā
• <caption> - tabulas nosaukums

Atribūti
• Cellpadding – attālums no teksta līdz malai
• Cellspacing – attālums starp šūnām
• Colspan – šūnu apvienošana horizontāli
• Rowspan – šūnu apvienošana vertikāli

You might also like