Issue
I'd like to format a table with each TR consisting of several TDs on line one and one TD on the second line, taking up the width of the entire row.
Something like this:
TD1----TD2----TD3-----
TD4-------------------
Not sure where to start with this... CSS? Embedded table? Hoping someone has done something similar.
Solution
You can create a table with multiple elements in the first row and a single element in the second row that spans the entire width of the row using HTML and CSS. Here's an example code:
<!DOCTYPE html>
<html>
<head>
<style>
table {
border-collapse: collapse;
width: 100%;
}
td {
border: 1px solid #000;
padding: 8px;
text-align: center;
}
td.full-width {
width: 100%;
}
</style>
</head>
<body>
<table>
<tr>
<td>Column 1</td>
<td>Column 2</td>
<td>Column 3</td>
</tr>
<tr>
<td class="full-width" colspan="3">Full Width</td>
</tr>
</table>
</body>
</html>
In this example, we have a table with two rows (). The first row contains three elements, and the second row contains one element with the full-width class, which spans the entire width of the table. The colspan="3" attribute is used to make the second span all three columns in the first row.
Answered By - Ali Raza
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.