Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,27 @@ a{
font-size:3em;
}
#table{
margin-left: auto;
margin-right: auto;
border-spacing: 15px;
width: auto;
display: table;
}

#table tr {
display: table-row;
text-align: center;
}

#table td {
text-align: center;
display: table-cell;
vertical-align: middle;
}

#table tr:last-child td:only-child {
display: block;
margin: 0 auto;
}

#bg {
Expand Down Expand Up @@ -45,10 +65,6 @@ a{
*[data-href] {
cursor: pointer;
}
#table{
margin-left: auto;
margin-right: auto;
}
#rcorners1 {
transition: transform .2s;
border-radius: 25px;
Expand All @@ -64,12 +80,11 @@ a{
border-radius: 25px;
background: #f3f2ed;
text-align: center;
/* padding: 20px; */
width: 15rem;
height:2rem;
margin-left: auto;
margin-right: auto;
}
height: 2rem;
margin: 0 auto;
display: inline-block;
}
#rcorners1:hover {
transform: scale(1.1);
}
Expand Down
29 changes: 14 additions & 15 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,23 @@ function procj(data){
return html;
}

if(Object.keys(data).length%2==0){
var tabledata = "<tr>";
for(var i=0;i<Object.keys(data).length;i++){
tabledata += html(Object.keys(data)[i],Object.values(data)[i]);
if((i+1)%2==0){

tabledata += "</tr>";
tabledata += "<tr>";
}

var tabledata = "<tr>";
var projectCount = Object.keys(data).length;

for(var i=0;i<projectCount;i++){
tabledata += html(Object.keys(data)[i],Object.values(data)[i]);
if((i+1)%2==0 && i < projectCount-1){
tabledata += "</tr><tr>";
}
tabledata += "</tr>"

}


// If we have an odd number of projects, add an empty cell to maintain layout
if(projectCount % 2 !== 0) {
tabledata += "<td style='visibility: hidden;'></td>";
}

tabledata += "</tr>";
return tabledata;


}


Expand Down