Пожалуйста, проверьте, если обновленный HTML.Я удалил лишние стили.Добавлен атрибут border для таблиц, а также добавлены отступы: 0 для элементов, создающих пробел (td).
<!DOCTYPE html>
<html>
<head>
</head>
<style>
table * {
border-spacing: 0;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body ng-app="myApp" ng-controller="myCtrl">
<table border="1" style="border-collapse: collapse;">
<tr>
<td ng-repeat="r2 in records2" style="text-align: center;height:100%;padding: 0;">
<table border="1">
<!-- here the margin needs to be modified in such a way that the inner table's border touches the outer table -->
<tr>
<td ng-repeat="r3 in records3" style="height:100%; border: 0;padding: 0">
<table style="width:100%;height:100%;border-right: 1px solid;">
<tr>
<td height="100%" style="padding: 5px;" ng-repeat="r1 in records1">
<div>
<span>
<span>
<span>
<a> {{r1}}
</a>
</span>
</span>
</span>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script>
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
$scope.records1 = [
"A",
"B",
"C",
"E",
]
$scope.records2 = [
"1",
"2",
]
$scope.records3 = [
"W",
"M",
]
});
</script>
</body>
</html>
См. Код здесь