|
Cookbook /
DefaultTableAttributesSummary: How to change the default attributes for tables created using PmWiki.Tables
Version: 2004-11-30
Prerequisites:
Status:
Maintainer: Pm
QuestionHow can I change the default attributes for tables created using PmWiki.Tables? AnswerIn a local configuration file, set $BlockMarkups['table'][0] to the value that you would like to be used for a table's opening <table> tag. Examples: $BlockMarkups['table'][0] = "<table width='100%'>";
$BlockMarkups['table'][0] = "<table border='1'>";
$BlockMarkups['table'][0] =
"<table width='100%' class='simpletable'>";
(Using width='100%' in an Internet Explorer environment can cause problems if the surrounding text block has margins. What seems to happen is IE treats the 100% as 100% of the browser width. If the left margin is, say, 20px, the table then protrudes 20px into the right margin. Other browsers don't behave this way.) Oh yes, that's correct. I had forgotten about this misfeature of Internet Explorer. We should come up with a better default. --Pm
DiscussionPmWiki treats lines beginning with An administrator can choose a different default for tables by changing the value of $BlockMarkups['table'][0] as described above. For example, to have tables default to 50% width with a 1-pixel border, an administrator would add the following to local/config.php: $BlockMarkups['table'][0] =
"<table width='50%' border='1'>";
Note that this does not prevent an author from overriding the defaults by using the Markup('^||', '>^||||');
See AlsoContributors
|