Upon writing the post on "dragon"yesterday, I encountered a problem which I had no idea how to solve. The thing is that, on my hand I have a list of data which I would like to display in the post in the form of a table. This first part was easy enough, anyway, the codes are as follow below:
<table border="1">So it will look something like this:
<tr>
<td>row 1, box 1</td>
<td>row 1, box 2</td>
</tr>
<tr>
<td>row 2, box 1</td>
<td>row 2, box 2</td>
</tr>
</table>
| row 1, box 1 | row 1, box 2 |
| row 2, box 1 | row 2, box 2 |
A) Start with this:
<table border="1">
B) To continue, just keep adding the codes.
- <tr> to start a new row
- <td> to open a new box, in this case row 1, box 1.
- </td> to close this box
- <td> to open a new box, in this case row 1, box 2.
- </td> to close this box
- continue till satisfied with number of columns.
- </tr> to close this whole row
- </table>
| Heading One | Heading Two |
|---|---|
| row 1, box 1 | row 1, box 2 |
| row 2, box 1 | row 2, box 2 |
D) To do this just add the following code above part B and you are done.
<tr>
<th>Heading One</th>
<th>Heading Two</th>
</tr>
If you have been following, you should get something like this:
<table border="1">Which would translate to being this:
<tr>
<th>Heading One</th>
<th>Heading Two</th>
<th>Heading Three</th>
</tr>
<tr>
<td>row 1, box 1</td>
<td>row 1, box 2</td>
<td>row 1, box 3</td>
</tr><tr>
<td>row 2, box 1</td>
<td>row 2, box 2</td>
<td>row 2, box 3</td>
</tr>
</table>
| Heading One | Heading Two | Heading Three |
|---|---|---|
| row 1, box 1 | row 1, box 2 | row 1, box 3 |
| row 2, box 1 | row 2, box 2 | row 2, box 3 |
Now if you get this, you should be happy, but the problem comes when you click publish. You realize that there is a huge blank space between your table and your text. You, like me, went back and look at the code and ponder if something is wrong. The problem is that in your blogger setting, you have most likely chosen yes to having linebreaks, which is not wrong. From what I understand, I might be wrong, blogger cannot distinguish between all the <br> and </br> etc.
So now, either you copy all your code to a notepad to remove all the linebreaks, or you manually backspace till all the codes cluttered together. Problem solved.
So in the spirit of discovering and learning new things, I have posted this, cause it caused me much agony. I think its important to be understand how all this works if you want to learn and not just copy and paste codes. Hopefully, this would be what you are looking for and end your frustration too. I think its important to be understand how all this works if you want to learn and not just copy and paste codes.
Cheers.





0 returned:
Post a Comment