Alright, in this section I will look at some general mistakes in coding and how to fix them. But before I go into that, here are a few tips for fixing code:|
>> Your own code won't be colored (it'll be completely white). Therefore, I will not color the code in this section either.
>> If you have construction of tables within tables and it's broken, separate the tables first and fix them separately before joining them.
>> The above also applies to tables in spoilers
>> If you cannot find the mistake by looking at the editor, copy the code (to another chapter/outside of your table) and put [code][/code] tags around it. It will be easier to find the error that way.
>> Every table must finish with [/td][/tr][/table] and every row must finish with [/td][/tr]. (Unless it's a spacing row)
>> Sometimes a table is just too hard to fix (especially if you missed multiple tags), don't be afraid to start over when everything becomes a terrible mess.
Now, I will use (half) the table I designed earlier and I'll break it.
- All the content in the table will be duplicated and appear (unformatted) below the table.
- All the content in the row where you forgot the [/tr] tag and all the content below will be duplicated, but it will still be formatted like it is in a table.
If you can't find the missing tag in the code of the first duplicated row, look whether you forgot the [/tr] tag of the previous row. This might be a spacing row so you cannot see that it duplicated itself.
- The content of the cell will be duplicated and appear above the table
There are two things that can happen when you forget [/td] tags.
1: You forgot the [/td] tag of the last cell in the row.
- Nothing more than the duplication of the content of that cell will happen.
2: You forgot the [/td] tag of a cell that is not the last cell in the row.
- The content of the cell where you forgot the [/td] tag will duplicate and appear above the table
- All the content of all the cells beyond that cell (in the same row) will duplicate and appear at the end of the same row in the table.
Because the content of the cells gets pasted in the same row as your cell, the entire table might be squashed together/surpass the maximum width of the table.
IMPORTANT NOTE 2:
If you forgot the [/td] of a spacing cell the content in your table will be duplicated, but nothing will appear at the top.
- Your entire table will not appear (just unformatted stuff) and you will find a [/table] tag at the end of the "table"
- A [/tr] tag will appear at the top of the table and depending on what row vanished, there might be a change in height.
- If there is no row with deformed height you have to check all rows
Again there are two cases.
1: You forgot the [td] tag of a cell at the end of the row.
- The content of the cell will not appear in the table but it will appear at the top of the table with a [/td] tag behind it.
- If the cell has no content, just the [/td] tag will appear above the table
2: You forgot the [td] tag of a cell in the middle/at the start of the row.
- The same thing happens as if it is a cell at the end of the row, but all the cells in the row "shift" to the left.
If you cannot find the missing tag, try pressing CTRL + F (search) and typing [/td][/td].
Forgetting a part of any of the table tags|
In case you forget one of the [ or ] of the [td], [/td], [tr], [/tr], [table] or [table] the same thing will happen as if you forgot the entire tag. However, your life becomes easier now because the tag (with missing [ or ]) will show up at the above the table.
Putting text between tags|
I'm not talking about putting text between the [td] and [/td] tags, but about putting it anywhere else. In this case it will also show up at the top of the table. This is the same thing
that would happen if you were to forget a [/td] tag.
The first thing you do when this happens is type CTRL + F and then whatever text appeared above the table!
IMPORTANT NOTE 2:
This also happens if you accidentally put [[td] instead of [td], (a lonely [ will appear above the table), try searching for [[td or [[tr in this case instead of just [ )