I am printing some list-group-items inside a card container like below it is not aligned properly. I'm using Bootstrap 4. My goal is to align all 3 fields in a neat tabbed column. Also open to other suggestions.
I used a | symbol as a separator. This is my code for what I have already done.
<!--HTML-->
<body>
<div class="containers">
<div class="container-fluid">
<div class="row">
<div class="col-6">
<div class="card">
<div class="card-header py-2">Testcases</div>
<div id="rightContainer" class="list-group" style="height:425px; overflow-y: scroll">
<!--Populated by JS function -->
</div>
</div>
</div>
</div>
</div>
</div>
</body>
And the script to populate the above card container is written below. (Why is it populated like this? Because some selection needs to happen, which I require to send to the backend via AJAX, for which the response calls a success function which calls the populate_rightcontainer()) :
<!--SCRIPT-->
<script>
function populate_rightcontainer(response) {
$("#rightContainer > a").removeClass("active");
$("#rightContainer > a").hide();
$("#rightContainer").empty();
for (i = 0; i < response.length; i++) {
var str = response[i].replace(/\s+/g, "");
var arr = str.split("|");
var testcase = arr[0] + " | " + arr[1] + " | " + arr[2];
if (arr[2] == "Passed") {
$("#rightContainer").append('<a class="list-group-item list-group-item-success py-0">' + testcase + "</a>");
}
if (arr[2] == "Failed") {
$("#rightContainer").append('<a class="list-group-item list-group-item-danger py-0">' + testcase + "</a>");
}
}
}
</script>
And it currently looks like this which is not pretty:

Can you help/suggest/modify my container align columns pretty?
Here is Plnkr of my code to play with:
http://plnkr.co/edit/EumtRHhzNb4nEFhScWjY?p=preview
P.S: Bonus fix would be when I tried to split by |, it didn't work unless I replaced/removed space, I messed up my timestamp as you can see in above picture. I don't know how to fix that now.
What you want isn't even close to possible in CSS alone, it needs to be done in HTML. Why not rebuild it as an ACTUAL table?
Something like this:
Edit: Here you go: http://next.plnkr.co/edit/xDIdHnC5tU5lGYPg?p=preview
HTML:
JS: