Last modified: 2011-03-13 18:06:43 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T8409, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 6409 - table alignment justify missing?
table alignment justify missing?
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.6.x
PC Windows XP
: Lowest normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-22 18:16 UTC by Gunter Schmidt
Modified: 2011-03-13 18:06 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Gunter Schmidt 2006-06-22 18:16:58 UTC
I can align a wiki table cell with align = "center" |, 
but "justify" does not work.
HTML tables with justify work perfectly.

Bug or feature?
Comment 1 Antoine "hashar" Musso (WMF) 2006-06-23 18:44:09 UTC
Using wikisyntax, we can use align="justify" the html
generated include it. The real problem is that "justify"
is not valid for attribute align:

From the HTML4 specification:

http://www.w3.org/TR/html4/struct/tables.html#h-11.2.1

align = left|center|right [CI]

Deprecated. This attribute specifies the position of
the table with respect to the document. Permitted values:
 * left: The table is to the left of the document.
 * center: The table is to the center of the document.
 * right: The table is to the right of the document.

The transitional XHTML 1.0 DTD tell us that element table
accept the "align" attributed which can take a %TAlign value:

<!ENTITY % TAlign "(left|center|right)">


Closing as invalid, as table can't have align="justify"
Comment 2 Gunter Schmidt 2006-06-23 19:41:33 UTC
I was talking about *cell* alignment, not table alignment.

http://www.w3.org/TR/html4/struct/tables.html#alignment

align = left|center|right|justify|char
Comment 3 Gunter Schmidt 2007-02-18 16:42:10 UTC
This is not a problem of MediaWiki. It is a problem of Internet Explorer 6.0. Firefox displays the table correct.

I made a pure html page with table cell justifiy and it does not display right in IE 6.0.

Comment 4 Gunter Schmidt 2007-02-18 16:43:27 UTC
For the curious: Try this with IE and Firefox:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="content-type">
  <title>Table justified</title>
</head>
<body>
<table style="position: relative;" align="center"
 border="1" cellspacing="0" width="80%">
  <tbody>
    <tr>
      <td align="left"><b>align left:</b> This
is a very long text that does not fit in one line of the cell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell. <br>
new line </td>
      <td align="right"><b>align right:</b>
This is a very long text that does not fit in one line of the cell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell. <br>
new line </td>
    </tr>
    <tr>
      <td align="middle"><b>align center:</b>
This is a very long text that does not fit in one line of the cell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell. <br>
new line </td>
      <td align="justify"><b>align justify:</b>
This is a very long text that does not fit in one line of the cell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell.
Thisisaverylongtextthat doesnotfitinonelineofthecell. <br>
new line </td>
    </tr>
  </tbody>
</table>
</body>
</html>
Comment 5 Gunter Schmidt 2007-02-18 16:48:43 UTC
Oh, there may be a solution to this. The parser.php may look for the justify tag...

Display Justified Text in HTML Table Cell in IE
To display justified text in a table cell, use the <p> HTML tag within the <td> tag with the attribute align set to "justify." So, 
instead of using: 

<td align="style="justify">Your text here.</td> 

Use this: 

<td><p align="justify">Your text here.</p></td> 


Ashish Mathur

Comment 6 Gunter Schmidt 2007-02-18 17:15:49 UTC
The parser could be changed to make it work:

	// Bug 553: Note that a '|' inside an invalid link should not
	// be mistaken as delimiting cell parameters
	if ( strpos( $cell_data[0], '[[' ) !== false ) {
		$cell = "{$previous}<{$last_tag}>{$cell}";
	} else if ( count ( $cell_data ) == 1 )
		$cell = "{$previous}<{$last_tag}>{$cell_data[0]}";
	else {
		$attributes = $this->mStripState->unstripBoth( $cell_data[0] );
		$attributes = Sanitizer::fixTagAttributes( $attributes , $last_tag );
+		// IE6.0 bug with justify cell
+		// justify has to be put into an additonal paragraph
+		$justifyPos = stripos($attributes,'justify');
+		if ($justifyPos) $cell_data[1] = '<p align = \'justify\'>' . $cell_data[1] . '</p>';
		$cell = "{$previous}<{$last_tag}{$attributes}>{$cell_data[1]}";
	}
Comment 7 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-03-06 03:43:29 UTC
Ugly, and problematic due to the restrictions on the contents of <p> tags. 
Plus, un-semantic in general.  If someone wants their justification to work in
IE, they'll have to add the <p> tags themselves if they want them.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links