I am using the aws .net sdk to get all security groups and show them in a table like so.
public object GetGroups()
{
var allSgRequest = new DescribeSecurityGroupsRequest();
var allSgResponse = client.DescribeSecurityGroups(allSgRequest);
var allSgGroups = allSgResponse.SecurityGroups;
return allSgGroups;
}
In my controller I call the method and pass the data into my view like so
public ActionResult SecurityGroups()
{
dynamic model = new ExpandoObject();
SecurityGroupModel sgm = new SecurityGroupModel();
var awsGroups = sgm.GetGroups();
model.group = awsGroups;
return View(model);
}
The variable awsGroups looks something like this
My table set up in my view uses the datatables plugin for JQuery and looks like this
@model dynamic
@{
ViewBag.Title = "SecurityGroups";
}
<script type="text/javascript" charset="utf8" src="//code.jquery.com/jquery- 1.10.2.js"></script>
<link rel="stylesheet" type="text/css" href="/DataTables/datatables.css" />
<script type="text/javascript" src="/DataTables/datatables.js"></script>
<h2>SecurityGroups</h2>
<table id="table" class="table table-bordred table-striped">
<thead>
<tr>
<th>Group ID</th>
<th>Group Name</th>
<th>VPC ID</th>
</tr>
</thead>
<tbody>
@foreach (var group in Model.group)
{
<td>@group.GroupId</td>
<td>@group.GroupName</td>
<td>@group.VpcId</td>
}
</tbody>
<script type="text/javascript">
$('#table').DataTable();
</script>
However when I run the program and go into my view the data displays weirdly and shows all of my groups on one row instead of displaying correctly on multiple rows. Something like this 
Why is my data being displayed only on one row?