The look of tables TW5

150 views
Skip to first unread message

tejjyid

unread,
Feb 23, 2017, 10:42:38 PM2/23/17
to TiddlyWiki
I have a table produced by a macro that looks slightly wonky under TW5.




You can see the odd spacing in the North cards; most clearly perhaps in the contrast between the erratic spacing of N's diamonds and the tight, even spacing of East's clubs. This is actually an improved version thanks to "text-align:center". The TWC version - from a string which *should be in all material respects identical - looks much more even, withouth any CSS intervantion from me.

* I know these words mean little; I had to change the string because TW5 doesn't easily support cell-level CSS, but all that involved was removing some inline CSS wrapping from the red suit symbols and repacing it with an "!" so I could switch the colour via tableheader. There are *no* gratuitous spaces in the underlying string.

** I wouldn't necessarily believe me either, but I have checked.

I can certainly live with the problem, but I'd like to eliminate it if possible.

Cheers

David Szego

unread,
Feb 23, 2017, 11:19:43 PM2/23/17
to TiddlyWiki
Try putting a non-breaking space between cards:

 

or setting CSS word-break and word-spacing properties:

https://www.w3schools.com/cssref/css3_pr_word-break.asp
https://www.w3schools.com/cssref/pr_text_word-spacing.asp

BJ

unread,
Feb 24, 2017, 4:44:48 AM2/24/17
to TiddlyWiki
Its difficult to say what the problem might be without see the code...

all the best
BJ

tejjyid

unread,
Feb 25, 2017, 4:10:10 AM2/25/17
to TiddlyWiki
Here's the string produced by my code in both TWC & TW5:
@@.bridgetable
|||||||||♠|T|5|3|
|||||||||!♥|Q|J|8|
|||||||||!♦|A|J|T|7|
|||||||||♣|Q|8|3|
|♠|K|4|||||||⌈|N|⌉||||||♠|Q|J|7|6|5|3|
|!♥|A|T|3||||||W| | ||||||!♥|K|T|9|4|
|!♦|K|T|8|5|4|||| | |E||||||!♦|2|
|♣|T|9|2||||||⌊|S|⌋||||||♣|K|4|
|||||||||♠|A|5|
|||||||||!♥|6|4|3|
|||||||||!♦|Q|8|4|
|||||||||♣|A|J|5|3|2|
@@

The only difference is in TWC the ! is replaced by @@color:red@@.

The CSS in both cases is the same:
.bridgetable tr:first-child th {color:red;text-align:center;}
.bridgetable td {background-color:white;}
.bridgetable {border-color:green;border-width:10px;}
.bridgetable th {background-color:white;color:red;}
.bridgetable,
.bridgetable td, 
.bridgetable tr, 
.bridgetable th
	{ border:0 !important; margin:0 !important; padding:0px !important; text-align:center; }

Presumably the reason they show up differently is that the wikifier in TWC & TW5 converts the string to different HTML.

tejjyid

unread,
Feb 25, 2017, 4:11:44 AM2/25/17
to TiddlyWiki
Thanks David, I've had a bit of luck playing around with the padding. I'll try these out as well.
Reply all
Reply to author
Forward
0 new messages