Jump to: navigation, search

HTML Table Border

From w3cyberlearnings

Contents

HTML Border

Create Table Border by using border attribute or CSS.

Note

Use border attribute to define the table border is obsoleted. Please use CSS instead.

Example 1 TRY-IT

we use border attribute to set the thickness of the border, and we use the bordercolor to set the border color respectively.

		<table border="1" bordercolor="green">
			<tr>
				<td>First</td>
				<td>Second</td>
				<td>Third</td>
				<td>Four</td>
				<td>Five</td>
			</tr>
			<tr>
				<td>1</td>
				<td>2</td>
				<td>3</td>
				<td>4</td>
				<td>5</td>
			</tr>
		</table>

Example 2 TRY-IT

We define the table color by using the CSS.

	<style>
			table,th,td {
				border:2px solid red;
			}
        </style>

Example 3 TRY-IT

		<style>
			table{
				border:2px solid red;
			}
			td {
				border:1px solid blue;
			}
		</style>

Example 4 TRY-IT

                 <style>
			table{
				border:2px solid red;
			}
			.bluec {
				border:1px solid blue;
			}
		</style>

Related Link


Table
  1. HTML - Table
  2. HTML - Table Border
  3. HTML - Table Column
  4. HTML - Table Row
  5. HTML - Table Color
  6. HTML - Table Cell Spacing and Padding
  7. HTML - Text Align
  8. HTML - Text Vertical Align
  9. HTML - Table Caption and Summary
  10. HTML - Table thead, tbody, tfoot
  11. HTML - Inner Table
  12. HTML - Table Vertical Line
  13. HTML - Table Horizontal Line
Navigation
Web
SQL
MISC
References