HTML Table Style Border Width
HTML Tutorial » HTML table style border width
The HTML table allows to arrange all data on the page like, text, images, links, forms, etc. into rows and columns of cells.
The HTML tables are created using the <table> tag, <tr> tag is used to create table rows and <td> tag is used to create data cells.
The elements under <td> are regular left aligned by default.
Syntax:
<tr>
<th>title_text</th> <!-- each line one column -->
...
...
...
</tr>
<tr>
<td>content</td> <!-- each line one column -->
...
...
...
</tr>
</table>
HTML table style - examples
An HTML table is defined with the <table> tag where we add style with: width, border color and more .
How we use style = "width:100%; border:#C30 thin solid; text-align:center" to add border around table.
<!DOCTYPE html>
<html>
<head>
<title>HTML style border colored around table</title>
</head>
<body>
</body>
<h1>HTML style border colored around table</h1>
<table style="width:100%; border:#C30 thin solid; text-align:center">
<tr >
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jilly</td>
<td>Ford</td>
<td>55</td>
</tr>
<tr>
<td>Eva</td>
<td>Sonjak</td>
<td>48</td>
</tr>
</table>
</html>
Related subjects:
HTML Table Style
HTML Table Width
Table Rowspan Colspan
HTML Table Colspan and Rowspan Attributes
If you want to merge two or more columns into a single column you will use colspan attribute.
If you want to merge two or more rows you will use rowspan.
<!DOCTYPE html>
<html>
<head>
<title>HTML Table Colspan and Rowspan Attributes</title>
</head>
<body>
</body>
<h1>HTML table Colspan and Rowspan Attributes</h1>
<table border = "1">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
<tr>
<td rowspan = "2">Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
<td>Row 1 Cell 3</td>
</tr>
<tr>
<td>Row 2 Cell 2</td>
<td>Row 2 Cell 3</td>
</tr>
<tr>
<td colspan = "3">Row 3 Cell 1</td>
</tr>
</table>
</html>
HTML Table Height and Width
You can specify table width and tabele height in pixels or percentage of available screen area.
<!DOCTYPE html>
<html>
<head>
<title>HTML Table Height and Width</title>
</head>
<body>
</body>
<h1>HTML Table Height and Width</h1>
<table border = "2" width = "450" height = "160">
<tr>
<td>Row 1, Column 1</td>
<td>Row 1, Column 2</td>
</tr>
<tr>
<td>Row 2, Column 1</td>
<td>Row 2, Column 2</td>
</tr>
</table>
</html>
Chapter Summary
HTML <table> - define a table
HTML <tr> - define a table row
HTML <td> - define a table data
HTML <th> - define a table heading
Use the HTML <caption> - define a table caption
Colspan attribute makes a cell span many columns
Rowspan attribute makes a cell span many rows
Id attribute uniquely define one table
HTML table, border, width, style, center, color, colspan, tag, rowspan, example, tag, css
HTML table column width, style, header, border style, width, padding, background collor
HTML table style, HTML border, width and height - html tutorial
This tool makes it easy to create, adjust, and experiment with custom colors for the web.

Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.

Find here examples of creative and unique website layouts.

Find here examples of creative and unique website CSS HTML menu.