I'm trying to add a border on table cells but I cannot figure out how to do it with rowspan.
I want a table that has 4 cells 1 big cell on the left and 3 small cells on the right of the big one.
Here's the code I used
jsfiddle[dot]net/1fv4dz5g/3/
To create table border in HTML, the border attribute was used. But the introduction of HTML5, deprecated the border tag. Create table border using the CSS property border. Set table border as well as border for <th> and <td>.
For HTML tables, you can use the border attribute to suggest the width of a border around the table and each cell. There are other methods defined in HTML 4 to suggest cell borders (or "rules", as they are called there) as separate from the overall border for the entire table.
The space between the table cells is controlled by the CELLSPACING attribute in the TABLE tag. By setting CELLSPACING to zero, you can remove all the space between the cells of your table. This removes all the space between the cells of our table (see Figure 9).
This can be done using CSS. Check this css sample
td {
border: 1px solid black;
}
<table class="tnews-side" border="0">
<tr>
<td rowspan="3">
<table border="1" cellpadding="4" cellspacing ="0">Row 1 Cell 1</table>
</td>
<td>Row 1 Cell 2</td>
</tr>
<tr>
<td>Row 2 Cell 2</td>
</tr>
<tr>
<td>Row 2 Cell 2</td>
</tr>
</table>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With