That's an old way of placing a border around the table. The better way to place a border around a table and cells is by using CSS:
table, td {
border-collapse: separate;
border: 1px solid #999;
}
jsFiddle example
Answer from j08691 on Stack OverflowThat's an old way of placing a border around the table. The better way to place a border around a table and cells is by using CSS:
table, td {
border-collapse: separate;
border: 1px solid #999;
}
jsFiddle example
I'm not here to debate on the old way versus the new way or which is better. Just saying...
As far as I know the border attribute on the table element is still standard in HTML5 and has not been "phased out." (See: http://www.w3schools.com/html5/tag_table.asp and http://www.w3.org/TR/html5/tabular-data.html#attr-table-border)
Though, it could be, I highly doubt it's a DOCTYPE issue. I tried your example code (I added an end tag to your open div), and the borders showed up just fine in various current browsers including Chrome.
I think you probably have some global CSS or something else in your code that you are using and haven't specifically mentioned here.
To clarify I used this exact code with the strict DTD and everything:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>test</title>
</head>
<body>
<div id="a">
<table id="main_table" border="1">
<tr>
<th>Jobs</th>
<th>Customers</th>
</tr>
</table>
</div>
</body>
</html>
Borders showed up in FF, IE8, and Chrome.
HTML5 supports 1 or empty string for this attribute.