\"Writing.Com
*Magnify*
SPONSORED LINKS
Printed from https://writing.com/main/forums/message_id/2146292
Rated: ASR · Message Forum · Writing.Com · #102362
Drop your new ideas into the Writing.Com Suggestion Box!
<< Previous  •  Message List  •  Next >>
Reply  •  Post New
Oct 5, 2010 at 10:09am
#2146292
Edited: October 5, 2010 at 10:29am
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: TABLES
by A Non-Existent User
You know, that might do the trick - just pass it to HTML.

If users want to mess with colspan and rowspan, they have to expect them to behave as the analogous HTML would. Then they don't have to learn something new, and when they mess it up, you can blame it on HTML, not writingML. *Smile*


Colspan and rowspan both (I think) work as tags on an individual cell (TD), with subsequent cells moving "around" them as needed.

The one trick is that you'd have to have a {} with multiple parameters - {cell cols:X rows:Y} = <TD colspan="X" rowspan="Y">


'Width' would be the other trick, since users would want to control the relative position of the columns. But you wouldn't want to support 'width' with each {cell}, especially not with cols and rows as parameters.

One option would be to have a dummy header row defined along with {table} to set up dimensions.

{table:10,40,20,20,10} could produce:

<TABLE WIDTH="100%"><TBODY><TR><TD WIDTH="10%"></TD><TD WIDTH="40%"></TD><TD WIDTH="20%"></TD><TD WIDTH="10%"></TD></TR>

As long as there's no padding etc, I think this 'setup' row would be invisible, but it would establish the relative positions of subsequent columns in the table.

I'm not sure, offhand, what would happen if the user, subsequently, added too many {cell}s in a row - would it stay within the region defined by <TABLE>?


With both opening and closing tags, you'd have to address the problems of users putting stuff between them. E.g. ...{/cell} I'm not in a proper TD field nyah nyah {cell}...

I don't know if this fits in with the order and flow of your parsing algorhithms, but you could use {hide} to deal with that.

E.G.
         {cell:cols=2,rows=3} = {/hide}<TD colspan="2" rowspan="3">
         {/cell} = </TD>{hide}

(i.e. use "hide" to remove anything between a table command {/...} and the next table command {...} so that while users could put stuff 'outside' of the cells in the table, it'd never be parsed...)

Though then, I suppose, a sneaky user would go ...{/cell}{/hide}nyah nyah{cell}... But if your parser just skips the text between a {/...} table command and the next {...} table command, it'd have the same effect w/o that loophole.



LP
MESSAGE THREAD
TABLES · 10-04-10 3:07pm
by A Non-Existent User
Re: TABLES · 10-04-10 3:30pm
by The StoryMaster Author IconMail Icon
Re: Re: TABLES · 10-04-10 4:24pm
by Jeff Author IconMail Icon
Re: Re: Re: TABLES · 10-04-10 4:38pm
by The StoryMaster Author IconMail Icon
Re: Re: Re: Re: TABLES · 10-04-10 4:55pm
by A Non-Existent User
Re: Re: Re: Re: Re: TABLES · 10-04-10 5:06pm
by The StoryMaster Author IconMail Icon
Re: Re: Re: Re: Re: Re: TABLES · 10-05-10 12:29am
by A Non-Existent User
Re: Re: Re: Re: Re: Re: Re: TABLES · 10-05-10 1:03am
by The StoryMaster Author IconMail Icon
Re: Re: Re: Re: Re: Re: Re: Re: TABLES · 10-05-10 1:17am
by A Non-Existent User
Re: Re: Re: Re: Re: Re: Re: Re: Re: TABLES · 10-05-10 1:27am
by The StoryMaster Author IconMail Icon
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: TABLES · 10-05-10 2:14am
by A Non-Existent User
*Star* Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: TABLES · 10-05-10 10:09am
by A Non-Existent User
Re: Re: TABLES · 10-04-10 4:25pm
by A Non-Existent User
Re: Re: Re: TABLES · 10-04-10 4:36pm
by The StoryMaster Author IconMail Icon

The following section applies to this forum item as a whole, not this individual post.
Any feedback sent through it will go to the forum's owner, The StoryMistress.
Printed from https://writing.com/main/forums/message_id/2146292