Website founded by
Milan Velimirović
in 2006

3:51 CET



Remember me

Forgot your
Click here!
to create your account if you don't already have one.

Rating lists


MatPlus.Net Forum General Table Formatting
You can only view this page!
(1) Posted by Milan Velimirović (+) [Tuesday, Nov 14, 2006 20:25]

Table Formatting

Text formatting is enhanced for HTML tables by some trimming of non-desired white spaces (including line breaks) to avoid the accumulation of empty lines above the table.

Also, an alternative and easier way for table formatting is introduced by defining five MatPlus specific tags (MPTags), which can be used instead of HTML markups. Each is available in two forms: as bracketed tag ([xx]) or circumflex-escaped character (^x). See the table, please.

MPTags (only when bracketed form) can contain the same attributes as normal HTML tags. White spaces (i.e. space, newline characters and tabs) are eaten on both sides of tags, so they can be used whenever needed for clarity while editting.

Except the "End table" other closing tags (i.e. corresponding to </tr>, </th> and </td>) are neither needed, nor allowed. MPTags can be written in uppercase or lowercase letters.

A drawback is that this provisional enhancement does not work correctly for nested tables. If they are needed, the first non-blank character should be an exclamation mark ("!"), and all tables instead of the inner one MUST be formatted using standard HTML tags.
BracketedEscapedHTML tag]Meaning
[tb]^t<table>Begin table
[tr]^r 2)<tr>Begin row
[th] 1)^h<th>Header cell
[td] 1)^d<td>Data cell
[te]^e</table>End table
1) Additional alignment specifier may be appended to the tag (in upper- or lowercase):
    "L" = left

2) this also forces top vertical aligment

E x a m p l e

Following pseudo-HTML definition:Outputs:
[tb border=1 cellspacing=0 cellpadding=2]
[td bgcolor=silver]King
[td bgcolor=silver]Queen
[td colspan=2
    style='border: medium outset silver;'
Note that the last cell is defined with "[td ... align=center]", which has
the same meaning as "[tdc ...]" with align attribute omitted.

Nobody expects you to compete for best designed post - it is more important WHAT you write then HOW. Nevertheless, when quoting problems it is more convenient to see the solution and/or comments next to the diagram than below it. This can be simply done by putting a "^t ^r ^d" (or simply "^p") before the diagram, "^d" between diagram and solution/comments and "^e" at end.

Addition: Three opening MPTags (^t ^r ^d) can be replaced by subsequently introduced shortcut ^p

Example (added marks are underlined):

(...some text)
^t ^r ^d [[Frsbqkbsrpppppppp32PPPPPPPPRSBQKBSR]]White to move and win

^d"Study of The Eternity"
Solution: 1.e4 etc.
Not computer tested!
(rest of the text...)


(...some text)
(= 16+16 )
White to move and win
"Study of The Eternity"

Solution: 1.e4 etc.

Not computer tested!

(rest of the text...)

My tests have shown the expected behaviour of new routine. This post is one of test samples. However, bugs are always possible and if you find some don't hesitate to inform me.
(Read Only)pid=200
(2) Posted by Harry Fougiaxis [Friday, Nov 17, 2006 22:38]

Maybe I'm missing something, but how can we have an empty line after the "End table" closing tag, so that any subsequent text stands out clearly from the diagram and the stipulation?
(Read Only)pid=211
(3) Posted by Milan Velimirović (+) [Saturday, Nov 18, 2006 02:02]

Harry: ...but how can we have an empty line after the "End table" closing tag

It was a bug. Now fixed!

Harry, you could make a fortune by testing software :)
(Read Only)pid=214

No more posts

MatPlus.Net Forum General Table Formatting