html tables Flashcards
table
oraganize data in html
<table>
</table>
create table
<tr>
</tr>
row
<td>
</td>
data/info to be input in table
left alligned
<th>
</th>
table header
by default it is set in bold and centered
border
table, th, td {
border: 1px solid black;
}
collapsed border
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
cell padding
thickness of border
th, td {
padding: 15px;
}
alignment
th {text-align: left;}
border spacing
table {border-spacing: 5px;}
colspan
<table>
<tr>
<th>Name</th>
<th>Telephone</th>
</tr>
<tr>
<td>Bill Gates</td>
<td>55577854</td>
<td>55577855</td>
</tr>
</table>
rowspan
<table>
<tr>
<th>Name:</th>
<td>Bill Gates</td>
</tr>
<tr>
<th>Telephone:</th>
<td>55577854</td>
</tr>
<tr>
<td>55577855</td>
</tr>
</table>
caption
must be inserted right after table tag
<table>
<caption>Monthly savings</caption>
</table>
onse style table
t01 {
To define a special style for one particular table, add an id attribute to the table:
width: 100%;
background-color: #f1f1c1;
}