HTML Code:
<!DOCTYPE html><!-- Declaration of HTML5 document type -->
<html>
<head>
<title>How to set border collapse initial answer</title><!-- Title of the HTML document -->
<style>/* CSS style start*/
table#mytable {
border-collapse:initial; /* Sets the border-collapse property to its initial value for the table with id "mytable" */
}
table, td, th {
border: 1px solid red; /* Sets a red solid border with 1px width for table, td, and th elements */
}
</style>
</head>
<body>
<table id="mytable"><!-- Start of the table with id "mytable" -->
<tr><!-- Start of the table row -->
<th>First Name</th><!-- Table header cell containing "First Name" -->
<th>Last Name </th><!-- Table header cell containing "Last Name" -->
</tr><!-- End of the table row -->
<tr><!-- Start of another table row -->
<td>Jack</td><!-- Table data cell containing "Jack" -->
<td>Bell</td><!-- Table data cell containing "Bell" -->
</tr><!-- End of the table row -->
<tr><!-- Start of another table row -->
<td>Peter</td><!-- Table data cell containing "Peter" -->
<td>Jhon</td><!-- Table data cell containing "Jhon" -->
</tr><!-- End of the table row -->
</table><!-- End of the table with id "mytable" -->
</body>
</html>
Explanation:
Live Demo:
See the Pen border-collapse-initial-answer by w3resource (@w3resource) on CodePen.
See the solution in the browser
Supported browser
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4