[pmwiki-devel] $SimpleTableDefaultClassName

0 views
Skip to first unread message

Simon

unread,
Sep 15, 2021, 6:09:16 AM9/15/21
to PmWiki Devel Mailing List

Could someone please tell me if this is working when you add
$SimpleTableDefaultClassName = "wikisimpletable";
to config.php.
I'm not seeing any change to the markup, just the same '<table width="100%">' from simple table markup, viz
|| my simple table ||


thanks

Simon

Petko Yotov

unread,
Sep 15, 2021, 6:25:37 AM9/15/21
to Simon, PmWiki Devel Mailing List
Yes, I can confirm it works as documented, you can set the default
simple table to any class name.

Check for interference by some local customization or recipe, I'd look
for:

$BlockMarkups['table']

Petko

On 15/09/2021 12:07, Simon wrote:
> https://www.pmwiki.org/wiki/PmWiki/LayoutVariables#SimpleTableDefaultClassName
>
> Could someone please tell me if this is working when you add
> $SimpleTableDefaultClassName [1] = "wikisimpletable";
> to config.php.
>
> I'm not seeing any change to the markup, just the same '<table
> width="100%">' from simple table markup, viz
> || my simple table ||
>
> thanks
>
> Simon
>

_______________________________________________
pmwiki-devel mailing list
pmwiki...@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Simon

unread,
Sep 15, 2021, 7:20:44 PM9/15/21
to Petko Yotov, PmWiki Devel Mailing List
Thanks very much
the only place  $BlockMarkups appears in any PHP file in this wiki is in pmwiki.php

It's very odd, because if I add
||width=*
as the first line to my simple table, I see
<table width="*" class="wikisimpletable">

If I remove that line its reverts to 
<table width="100%">

nhā mihi

Simon

Petko Yotov

unread,
Sep 16, 2021, 8:58:09 AM9/16/21
to Simon, PmWiki Devel Mailing List
Sorry, I didn't quite notice that you're using the markup incorrectly.
Simple table markup is not:

|| cell ||

You need to use:

||
|| cell ||

Note the first double vertical bars. They can optionally be followed by
table attributes such as border or width, but even if they aren't, the
bars are required. Feel free to update the documentation.


If you don't have the initial double bars, it will get messy. For
example, a title="..." attribute or something else from another element
may get absorbed into this partial table.

Petko

--
If you upgrade : http://www.pmwiki.org/Upgrades


On 16/09/2021 01:19, Simon wrote:
> Thanks very much
> the only place $BlockMarkups appears in any PHP file in this wiki is
> in
> pmwiki.php
>
> It's very odd, because if I add
> ||width=*
> as the first line to my simple table, I see
> <table width="*" class="wikisimpletable">

> (example <https://ttc.org.nz/pmwiki/pmwiki.php/FixtureCard/2022Hanmer>)


>
> If I remove that line its reverts to
> <table width="100%">
>
> nhā mihi
>
> Simon
>
> On Wed, 15 Sept 2021 at 22:24, Petko Yotov <5...@5ko.fr> wrote:
>
>> Yes, I can confirm it works as documented, you can set the default
>> simple table to any class name.
>>
>> Check for interference by some local customization or recipe, I'd look
>> for:
>>
>> $BlockMarkups['table']
>>
>> Petko
>>
>> On 15/09/2021 12:07, Simon wrote:
>> >
>> https://www.pmwiki.org/wiki/PmWiki/LayoutVariables#SimpleTableDefaultClassName
>> >
>> > Could someone please tell me if this is working when you add
>> > $SimpleTableDefaultClassName [1] = "wikisimpletable";
>> > to config.php.
>> >
>> > I'm not seeing any change to the markup, just the same '<table
>> > width="100%">' from simple table markup, viz
>> > || my simple table ||
>> >
>> > thanks
>> >
>> > Simon
>> >
>>
>

Simon

unread,
Sep 16, 2021, 7:41:06 PM9/16/21
to Petko Yotov, PmWiki Devel Mailing List
Wow, all these years.
This is not intuitive, and won't make sense to my wiki users :-(

cheers


Simon

unread,
Sep 16, 2021, 7:57:49 PM9/16/21
to Petko Yotov, PmWiki Devel Mailing List
Just a further note on this.
This would be less of a problem is the default markup for simple tables was not set to "width=100%", i.e. if this was not hard coded in the generated HTML

ngā mihi

Simon

Petko Yotov

unread,
Sep 17, 2021, 12:05:50 AM9/17/21
to Simon, PmWiki Devel Mailing List
Okay, I found a way for you to set the same classname to both correctly
defined table markups and incomplete markups. Set both previously
discussed variables:

$SimpleTableDefaultClassName = "mydefaultclassname";
$BlockMarkups['table'][0] = "<table width='100%'
class='$SimpleTableDefaultClassName'>";

And, here is where you can remove the "width='100%'" part.

I still recommend against removing the initial double-bar line if you
want support and consistent results.

Otherwise, as I said, it may unexpectedly pick some attribute from
something else, for example a title="..." attribute from a (:details:)
element later in the page, or the attributes from previous tables like
on the PITS page you edited. It is therefore unsupported and should not
be used and documented.

Petko

Reply all
Reply to author
Forward
0 new messages