]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
do_cmd_seetext(): Clean up so we get proper nesting of <div>s. This
authorFred Drake <fdrake@acm.org>
Wed, 28 Apr 1999 13:54:30 +0000 (13:54 +0000)
committerFred Drake <fdrake@acm.org>
Wed, 28 Apr 1999 13:54:30 +0000 (13:54 +0000)
   fixes a rendering problem on IE5.

General adjustments to the table* environments, including using
<thead> and <tbody>.  Attempt to adjust the vertical alignment of the
table cells so that the baseline of the first cell matches the
baseline of the remaining cells:  When the first cell is small and the
second cell of the same row is multi-line, the first cell was
vertically centered by default.  Specifying valign=baseline fixes the
problem on IE, but Netscape seems to ignore both valign=top and
valign=baseline (even though valign is NS's fault!).  Make the
horizontal alignment of 'p' columns left instead of center (for the
headings).

Doc/perl/python.perl

index eb6dfdf4e2171cf67b565d6214d01b57acaaabf9..8eb46186df55b989b0e668b03106229bd44f9176 100644 (file)
@@ -777,6 +777,18 @@ sub do_cmd_memberlineni{
 
 $TABLE_HEADER_BGCOLOR = $NAV_BGCOLOR;
 
+sub get_th{
+    my $a = @_[0];
+    my $r = '<th>';
+    if ($a eq 'l')
+      { $r = '<th align=left>'; }
+    elsif (substr($a, 0, 1) eq 'p')
+      { $r = '<th align=left>'; }
+    elsif ($a eq 'r')
+      { $r = '<th align=right>'; }
+    return $r;
+}
+
 sub setup_column_alignments{
     local($_) = @_;
     my($a1,$a2,$a3,$a4) = split(/[|]/,$_);
@@ -785,16 +797,8 @@ sub setup_column_alignments{
     $col_aligns[1] = (($a2 eq 'c') ? '<td align=center>' : '<td>');
     $col_aligns[2] = (($a3 eq 'c') ? '<td align=center>' : '<td>');
     $col_aligns[3] = (($a4 eq 'c') ? '<td align=center>' : '<td>');
-    # return the aligned header start tags; only used for \begin{tableiii?}
-    $th1 = (($a1 eq 'l') ? '<th align=left>'
-           : ($a1 eq 'r' ? '<th align=right>' : '<th>'));
-    $th2 = (($a2 eq 'l') ? '<th align=left>'
-           : ($a2 eq 'r' ? '<th align=right>' : '<th>'));
-    $th3 = (($a3 eq 'l') ? '<th align=left>'
-           : ($a3 eq 'r' ? '<th align=right>' : '<th>'));
-    $th4 = (($a4 eq 'l') ? '<th align=left>'
-           : ($a4 eq 'r' ? '<th align=right>' : '<th>'));
-    return ($th1, $th2, $th3, $th4);
+    # return the aligned header start tags
+    return (get_th($a1), get_th($a2), get_th($a3), get_th($a4));
 }
 
 sub do_env_tableii{
@@ -806,12 +810,14 @@ sub do_env_tableii{
     $font = ''
         if ($font eq 'textrm');
     $globals{'lineifont'} = $font;
-    return '<table border align=center>'
+    return '<table border align=center><thead>'
            . "\n  <tr$TABLE_HEADER_BGCOLOR>"
           . "\n    $th1<b>$h1</b></th>"
           . "\n    $th2<b>$h2</b></th>"
+          . "\n</thead>"
+          . "\n<tbody valign=baseline>"
           . $_
-          . "\n</table>";
+          . "\n</tbody></table>";
 }
 
 sub do_cmd_lineii{
@@ -839,13 +845,15 @@ sub do_env_tableiii{
     $font = ''
         if ($font eq 'textrm');
     $globals{'lineifont'} = $font;
-    return '<table border align=center>'
+    return '<table border align=center><thead>'
            . "\n  <tr$TABLE_HEADER_BGCOLOR>"
           . "\n    $th1<b>$h1</b></th>"
           . "\n    $th2<b>$h2</b></th>"
           . "\n    $th3<b>$h3</b></th>"
+          . "\n</thead>"
+          . "\n<tbody valign=baseline>"
           . $_
-          . "\n</table>";
+          . "\n</tbody></table>";
 }
 
 sub do_cmd_lineiii{
@@ -876,14 +884,16 @@ sub do_env_tableiv{
     $font = ''
         if ($font eq 'textrm');
     $globals{'lineifont'} = $font;
-    return '<table border align=center>'
+    return '<table border align=center><thead>'
            . "\n  <tr$TABLE_HEADER_BGCOLOR>"
           . "\n    $th1<b>$h1</b></th>"
           . "\n    $th2<b>$h2</b></th>"
           . "\n    $th3<b>$h3</b></th>"
           . "\n    $th4<b>$h4</b></th>"
+          . "\n</thead>"
+          . "\n<tbody valign=baseline>"
           . $_
-          . "\n</table>";
+          . "\n</tbody></table>";
 }
 
 sub do_cmd_lineiv{
@@ -1056,7 +1066,9 @@ sub do_cmd_seemodule{
 }
 
 sub do_cmd_seetext{
-    return '<div class=seetext><p>' . @_[0] . '</div>';
+    local($_) = @_;
+    my $content = next_argument();
+    return '<div class=seetext><p>' . $content . '</div>' . $_;
 }