PDA

View Full Version : A query about formatting



Weimann
2009-11-25, 03:30 PM
The {table] tag in particular.

I want the data in the cells to be center-aligned for ease of reading. It works good to enclose the first line with a [center] tag, but for every subsequent line, I seem to have to enclose each individual cell in such a tag. This leads to some problems when I have many cells in a line, with some tags disappearing (possibly due to lack of space?).

Does anyone know a more efficient way to do this?

Shhalahr Windrider
2009-11-25, 05:29 PM
Yeah, there's a bug. I seem to recall there being a solution, but I can't seem to get it correct at the moment.

[hr]
EDIT:
{table="width=450px"]
Center 1|
Center 2


Center 3|
Center 4[/table]

Okay, the bug affects cells that use alignment tags at the beginning and end of rows. This can be eliminated by placing an extra space between the closing tag at the upper row, and then use two carriage returns to start the new row. If you quote this post, you will see that is what I did above.

Weimann
2009-11-25, 07:45 PM
Thanks a lot! That should alleviate the problem with disappearing tags!

I take it there's no way to center align all cells in a row, though?_ It has to be done cell by cell?

Shhalahr Windrider
2009-11-25, 11:43 PM
I take it there's no way to center align all cells in a row, though?_ It has to be done cell by cell?
You can place center tags around a table to affect all cells in the table, but you can't call out specific rows at once. Trying to do that would break the HTML the BBCode generates.

So, this is valid:


{table="width=400px"]Cell 1|Cell2
Cell 3|Cell4[/table]

( Produces:

{table="width=400px"]Cell 1|Cell2
Cell 3|Cell4[/table])

But this is not:
{table="width=400px"]
Cell 1|Cell2


Cell 3|Cell4[/table]

(Produces:
{table="width=400px"]
Cell 1|Cell2


Cell 3|Cell4[/table]

Which is the result of the replacement code generating improperly nested HTML inside a table.)

quicker_comment
2009-11-26, 06:00 AM
In case it's not clear, as shown above, placing center tags around the entire table centers the table itself, not the text inside the cells. So to do what you want you do need to place tags in every cell.

Weimann
2009-11-26, 10:41 AM
Roger that. Thanks for the explanations :)

Shhalahr Windrider
2009-11-26, 10:47 AM
In case it's not clear, as shown above, placing center tags around the entire table centers the table itself, not the text inside the cells.
It centers the text in Opera as well as the table. I thought it was odd it was just centering the table for everything else until I realized that the code was using an HTML align attribute instead of CSS text-align.