Table in html|Table kaisee banaye hml me
YouTube
Here is a basic example of how to create a table in HTML:
```
<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th>
</tr>
<tr>
<td>Row 1, Cell 1</td>
<td>Row 1, Cell 2</td>
<td>Row 1, Cell 3</td>
</tr>
<tr>
<td>Row 2, Cell 1</td>
<td>Row 2, Cell 2</td>
<td>Row 2, Cell 3</td>
</tr>
</table>
```
In this example:
- `<table>` is the opening tag for the table.
- `<tr>` is the opening tag for a table row.
- `<th>` is the opening tag for a table header cell.
- `<td>` is the opening tag for a table data cell.
- `</tr>`, `</th>`, and `</td>` are the closing tags for their respective elements.
You can add more rows and cells as needed, and use various attributes to customize the table's appearance and behavior.
Some common attributes for table elements include:
- `border`: specifies the border width and style.
- `cellpadding`: specifies the space between cells.
- `cellspacing`: specifies the space between cells and the table border.
- `width` and `height`: specify the table's dimensions.
- `align` and `valign`: specify the alignment of text within cells.
For example:
```
<table border="1" cellpadding="5" cellspacing="0" width="50%">
...
</table>
```
This code creates a table with a 1-pixel border, 5 pixels of padding between cells, and a width of 50% of the containing element.
0 टिप्पणियाँ