My current issue involves a list of objects displayed in a table view created with aspmvc. The problem is that all the elements are not aligned properly, and I want them to be centered within the table. Here's what it looks like: https://i.sstatic.net/oUu5M.png
The code I'm using seems pretty generic, as it's mostly generated by default.
<table class="table">
<tr>
<th>
@Html.DisplayNameFor(model => model.m_EmailAddress)
</th>
(...)
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.m_EmailAddress)
</td>
(...)
</tr>
I've attempted to align everything to the center with this code:
<table class = "table" align = "center">
However, it didn't work out as expected.
If anyone has suggestions or can point me in the right direction, I would greatly appreciate it. Thank you!
Edit:
I also tried using <th text-align: center>
, but the alignment still appears off to the left. Here's how it currently looks: https://i.sstatic.net/xtDZm.png