Wyciagnolem sobie funkcje z wiki. ktora przerabia takie cuś np.:
{| border="1" cellpadding="2" cellspacing="0" align="right" width="300px" style="margin-left: 0.5em; margin-bottom: 0.5em" |+ Rumunia
România | align="center" colspan="2" style="background:#efefef;" | {| border="0" cellpadding="2" cellspacing="0" | align="center" width="160px" | Flaga Rumunii | align="center" width="140px" | Godło Rumunii |- | align="center" width="160px" | (o fladze) | align="center" width="140px" | (o godle) |} |---- | align="center" colspan="2" style="border-bottom:3px solid gray;" | Dewiza: brak |---- | align="center" colspan="2" | |---- | Język urzędowy | rumuński |---- | Stolica | Bukareszt |---- | Ustrój polityczny | demokracja parlamentarna |---- | Głowa państwa
| prezydent
Traian Băsescu |---- | Szef administracji
| premier
Calin Popescu-Tariceanu |---- | Powierzchnia
- całkowita
- wód śródląd. | 78.
238 391 km²
3,0% |---- | Liczba ludności
- ogółem (2003)
- gęstość zalud. | 49.
22 271 839
93,4/km² |---- | Uzyskanie niepodległości | od Imperium Osmańskiego
9 maja 1877 |---- | Waluta | Lej (ROL) |---- | Strefa czasowa | UTC +2 |---- | Hymn państwowy | ''Deşteaptă-te, Române!'' |---- | Domena internetowa | .ro |---- | Kod samochodowy | RO |---- | Numer kierunkowy | 40 |---- | align="center" colspan="2" style="border-bottom:3px solid gray;" | |}
na normalną tabelę..
funkcja wygląda tak:
<?php function doTableStuff ( $t ) { // tabela $fname = 'Parser::doTableStuff'; wfProfileIn( $fname ); $indent_level = 0; # indent level of the table foreach ( $t AS $k => $x ) { $t[$k] = \"n\" . '<table ' . $this->fixTagAttributes ( $matches[2] ) . '>' ; } $z = \"</table>\" . substr ( $x , 2) . \"n\"; } $z = '' ; $t[$k] = $z ; } # $x is a table row $fc = '+' ; } $t[$k] = '' ; # Loop through each table cell foreach ( $after AS $theline ) { $z = '' ; if ( $fc != '+' ) { } if ( $fc == '|' ) $l = 'td' ; else if ( $fc == '!' ) $l = 'th' ; else if ( $fc == '+' ) $l = 'caption' ; else $l = '' ; # Cell parameters # Note that a '|' inside an invalid link should not # be mistaken as delimiting cell parameters } $y = \"{$z}<{$l}>{$y[0]}\" ; else $y = $y = \"{$z}<{$l} \".$this->fixTagAttributes($y[0]).\">{$y[1]}\" ; $t[$k] .= $y ; } } } # Closing open td, tr && table { $t[] = '</table>' ; } # $t = $this->removeHTMLtags( $t ); wfProfileOut( $fname ); return $t ; } ?>
i mam takie pytanie jak by wykorzystac ten kod



z góry dzięki za pomoc