Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

border-collapse using HTML attribute

Tags:

html

Is there an HTML attribute available equivalent to the CSS property border-collapse: collapse;?

I am trying to achieve the same 1px border with HTML only, and not using css.

table{
  border-collapse: collapse;
}
<table border="1px" cellpadding="3">
  <tr>
<td>Row 1</td>
<td>Row 1</td>
<td>Row 1</td>
  </tr>
  <tr>
<td>Row 2</td>
<td>Row 2</td>
<td>Row 2</td>
  </tr>
</table>
like image 677
Felix A J Avatar asked Jan 06 '23 15:01

Felix A J


1 Answers

You could try cellspacing.

<table border="1px" cellspacing="0" cellpadding="3">
  <tr>
<td>Row 1</td>
<td>Row 1</td>
<td>Row 1</td>
  </tr>
  <tr>
<td>Row 2</td>
<td>Row 2</td>
<td>Row 2</td>
  </tr>
</table>

Note: cellspacing doesn't overlap borders of adjacent cells, which CSS property does.

like image 99
divy3993 Avatar answered Jan 22 '23 08:01

divy3993