I have html code that prints all of the posts inside an html table.
However, if there are no posts then I need to print an error No posts found.
Now focus on the error message
I am trying to print the error message in the center of the table.
<style>
table{border-collapse:collapse}
td{background-color:white;padding:10px}
.first_tr td{background-color:#f1f7f7 !important;border-bottom:1px red solid}
</style>
<table border="0" width="400px">
<tr class="first_tr"><td width="20%">POST ID</td><td width="79%">POST TITLE</td></tr>
<tr><td>No posts found</td></tr>
</table>
Here is an example: http://jsfiddle.net/9UhTd/
The error message is shown in the begin of the table, but I am trying to center it!
To start with, you’re missing a colspan attribute on your second row’s only cell
Without it, that cell will only take up the space of the cell above it. With that resolved you can go on to center it how ever you please
or
Your jsfiddle with this implemented