2.1k views
0 votes
PLEASE HELP ASAP!!!

Write the code for a table with two rows and three columns. The top row of cells should be table headers, and the table should have a caption.

User Jasmine
by
7.2k points

1 Answer

3 votes

If you are using CSS :

table {

border-collapse: collapse;

border: 5px solid black;

width: 100%;

}

td {

width: 50%;

height: 2em;

border: 1px solid #ccc;

}

HTML

<table>

<tbody>

<tr><td></td><td></td></tr>

<tr><td></td><td></td></tr>

<tr><td></td><td></td></tr>

</tbody>

</table>

for HTML:

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Sample table</title>

<style>

table {

border-collapse: collapse;

border: 5px solid black;

width: 100%;

}

td {

width: 50%;

height: 2em;

border: 1px solid #ccc;

}

</style>

</head>

<body>

<table>

<tbody>

<tr><td></td><td></td></tr>

<tr><td></td><td></td></tr>

<tr><td></td><td></td></tr>

</tbody>

</table>

</body>

</html>

User SenK
by
7.4k points