Template talk:Numbered block/Archive 1

Works poorly when next to an image


NumBlk uses a table of 100% width, and that makes it work poorly when it happens to be next to a right-aligned image. In particular, the equation number gets placed inside the image. For example,

If somehow a float was used, then the numeral could be put in the right spot. For example (this example is NOT using a NumBlk; it's using div's with style tags):


 * $$\frac{v_{\text{in}}-v_x}{Z_1}=\frac{v_x-v_{\text{out}}}{Z_4}+\frac{v_x-v_-}{Z_2}.$$ (2)

As you can see, the latter case looks much better than the former.

Things are much worse when next to a left-aligned image.



NumBlk uses a table of 100% width, and so the equation number gets placed off the page. For example,

If somehow a float was used, then the numeral could be put in the right spot. For example (this example is NOT using a NumBlk; it's using div's with style tags):


 * $$\frac{v_{\text{in}}-v_x}{Z_1}=\frac{v_x-v_{\text{out}}}{Z_4}+\frac{v_x-v_-}{Z_2}.$$ (2)

As you can see, again, the latter case looks much better than the former.

Is there a way to fix this behavior? &mdash;TedPavlic (talk) 13:47, 30 January 2009 (UTC)

It seems that just simply removing "width:100%" in the template can fix it:







However, more tests are needed to make sure there is no other side effects. - Justin545 (talk) 08:05, 3 February 2009 (UTC)
 * I'm OK with this "fix." I say be WP:BOLD and remove it. This template is clearly still in beta anyway. &mdash;TedPavlic (talk) 16:05, 3 February 2009 (UTC)
 * The fix has been submitted (as you should be able to see on this page). I created this template though, everyone is welcome to revise and fix problems about the template as long as the template gets better and better :-) - Justin545 (talk) 03:55, 4 February 2009 (UTC)


 * By the way, I cannot observe the issue in IE7, but it does exist in Firefox. - Justin545 (talk) 09:08, 3 February 2009 (UTC)
 * In particular, it appears like IE7 inserts clears to get around the issue. That is, if you have an element that spans the page, it figures that you implied that there should be a clear first. I'm not sure that's a good behavior... So it's either a bug in Firefox, IE, or both. Personally, I vote for them both getting it wrong. &mdash;TedPavlic (talk) 16:05, 3 February 2009 (UTC)

Problem embedding into tables
This template seems to break horizontal alignment if it is used inside a table. It isn't very surprising, but it may be difficult to track down the problem unless it is a documented issue. Here is an illustration of the problem:

Horizontal alignment is now broken. siℓℓy rabbit (  talk  ) 03:55, 23 July 2008 (UTC)


 * It seems to be a bug of MediaWiki. MediaWiki seems to translate from wikitext to html incorretly with respect to the syntax you gave. Each indentation is translated into a pair of  and  . But if you look at the html source, you should find the closing  is put at wrong place rather than near the end of the table. (sorry for the delayed response) - Justin545 (talk) 08:57, 3 February 2009 (UTC)

I suspect your attempt to embed a NumBlk into a table is to solve the following Works poorly when next to an image problem. If that's the reason, you should now be safe to do it again since it has been fixed. To support my words above, you can verify it by adding  manually at the end of the table to forcibly close the indentation like this:

Now, the horizontal alignment is NOT broken.

This alternative trick can be viewed as a pretty dirty and poor workaround for you problem, partly because it makes  and  pairs unbalanced. - Justin545 (talk) 07:44, 4 February 2009 (UTC)

Or, a better way is to abandon using of wikitext indentation. Directly use  and  tags instead: <dl><dd> </dd></dl> Now, the horizontal alignment is NOT broken as well and the balancing is held. - Justin545 (talk) 08:10, 4 February 2009 (UTC)

Recommend to 'purge' the pages after the modification
MediaWiki used to cache page contents on the server. When a change is made, the page is marked as touched and the software will create a new copy of the page for the server cache. However, when a change is made to a subpage or template, but not to the article page which transcludes it, the article page is not marked as touched, and a new copy is "not" generated for the cache.

Which means you may not see the pages using this template update immediately after you modify this template. In addition, you may not see Template:NumBlk update immediately after you modify Template:NumBlk/doc. By PURGE, you can force them to be updated.

To purge a page:
 * 1) At the end of the URL in the address bar of your browser, add the text
 * 2) Press [Enter] or click "Go" to tell the browser to go to that revised URL

See Purge for more information. - Justin545 (talk) 01:47, 5 February 2009 (UTC)

Border style is overridden within a 'wikitable' despite whatever the value of parameter 'Border' is
The border style of NumBlk is overridden by table of class wikitable:
 * {|style="border-collapse:collapse; background:none;" border=


 * -style="height:3pt"
 * nowrap rowspan="2"|<p style="margin:0pt 0pt 0pt 0pt;">$$ax^2+bx+c=0$$
 * <p style="font-size:1pt; margin:0pt 0pt 0pt 0pt;">
 * nowrap rowspan="2" align="right"|<p style="margin:0pt 0pt 0pt 0pt;">
 * -style="height:2pt"
 * style="border-top:3px dotted #e5e5e5; width:99%;"|<p style="font-size:1pt; margin:0pt 0pt 0pt 0pt;">
 * }
 * {|style="border-collapse:collapse; background:none;" border=
 * {|style="border-collapse:collapse; background:none;" border=

produces
 * -style="height:3pt"
 * nowrap rowspan="2"|<p style="margin:0pt 0pt 0pt 0pt;">$$ax^2+bx+c=0$$
 * <p style="font-size:1pt; margin:0pt 0pt 0pt 0pt;">
 * nowrap rowspan="2" align="right"|<p style="margin:0pt 0pt 0pt 0pt;">
 * -style="height:2pt"
 * style="border-top:3px dotted #e5e5e5; width:99%;"|<p style="font-size:1pt; margin:0pt 0pt 0pt 0pt;">
 * }
 * }
 * }
 * {|style="border-collapse:collapse; background:none;" border=


 * -style="height:3pt"
 * nowrap rowspan="2"|<p style="margin:0pt 0pt 0pt 0pt;">$$ax^2+bx+c=0$$
 * <p style="font-size:1pt; margin:0pt 0pt 0pt 0pt;">
 * nowrap rowspan="2" align="right"|<p style="margin:0pt 0pt 0pt 0pt;">
 * -style="height:2pt"
 * style="border-top:3px dotted #e5e5e5; width:99%;"|<p style="font-size:1pt; margin:0pt 0pt 0pt 0pt;">
 * }
 * {|style="border-collapse:collapse; background:none;" border=
 * {|style="border-collapse:collapse; background:none;" border=

which is an unwanted result. Thus, the template should be altered to explicitly specify the border style:
 * -style="height:3pt"
 * nowrap rowspan="2"|<p style="margin:0pt 0pt 0pt 0pt;">$$ax^2+bx+c=0$$
 * <p style="font-size:1pt; margin:0pt 0pt 0pt 0pt;">
 * nowrap rowspan="2" align="right"|<p style="margin:0pt 0pt 0pt 0pt;">
 * -style="height:2pt"
 * style="border-top:3px dotted #e5e5e5; width:99%;"|<p style="font-size:1pt; margin:0pt 0pt 0pt 0pt;">
 * }
 * }
 * }
 * {|style="border-collapse:collapse; background:none;"

produces
 * -style="height:3pt"
 * style="border:thin solid;" nowrap rowspan="2"|<p style="margin:0pt 0pt 0pt 0pt;">$$ax^2+bx+c=0$$
 * style="border:thin solid;"|<p style="font-size:1pt; margin:0pt 0pt 0pt 0pt;">
 * style="border:thin solid;" nowrap rowspan="2" align="right"|<p style="margin:0pt 0pt 0pt 0pt;"> (5)
 * -style="height:2pt"
 * style="border-left:thin solid; border-top:3px dotted #e5e5e5; border-right:thin solid; border-bottom:thin solid; width:99%;"|<p style="font-size:1pt; margin:0pt 0pt 0pt 0pt;">
 * }
 * }
 * }
 * {|style="border-collapse:collapse; background:none;"


 * -style="height:3pt"
 * style="border:thin solid;" nowrap rowspan="2"|<p style="margin:0pt 0pt 0pt 0pt;">$$ax^2+bx+c=0$$
 * style="border:thin solid;"|<p style="font-size:1pt; margin:0pt 0pt 0pt 0pt;">
 * style="border:thin solid;" nowrap rowspan="2" align="right"|<p style="margin:0pt 0pt 0pt 0pt;"> (5)
 * -style="height:2pt"
 * style="border-left:thin solid; border-top:3px dotted #e5e5e5; border-right:thin solid; border-bottom:thin solid; width:99%;"|<p style="font-size:1pt; margin:0pt 0pt 0pt 0pt;">
 * }
 * }
 * }

Justin545 (talk) 06:25, 6 February 2009 (UTC)