[LON-CAPA-cvs] cvs: loncom /interface domainprefs.pm

raeburn raeburn at source.lon-capa.org
Sun May 24 23:11:38 EDT 2026


raeburn		Mon May 25 03:11:38 2026 EDT

  Modified files:              
    /loncom/interface	domainprefs.pm 
  Log:
  - WCAG 2.2 AA compliance
    - Include labels for form elements.
    - Replace use of <table> for layout with <div>.
    - Group form elements in fieldset with legend for screenreaders.
    - Satisfy minimum spacing between touch targets.
    - Satisfy w3c validation
  
  
-------------- next part --------------
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.459 loncom/interface/domainprefs.pm:1.460
--- loncom/interface/domainprefs.pm:1.459	Wed May 20 16:01:16 2026
+++ loncom/interface/domainprefs.pm	Mon May 25 03:11:38 2026
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.459 2026/05/20 16:01:16 raeburn Exp $
+# $Id: domainprefs.pm,v 1.460 2026/05/25 03:11:38 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -319,13 +319,13 @@
                    { text => 'Default color schemes',
                      help => 'Domain_Configuration_Color_Schemes',
                      header => [{col1 => 'Student Settings',
-                                 col2 => '',},
+                                 col2 => 'Details',},
                                 {col1 => 'Coordinator Settings',
-                                 col2 => '',},
+                                 col2 => 'Details',},
                                 {col1 => 'Author Settings',
-                                 col2 => '',},
+                                 col2 => 'Details',},
                                 {col1 => 'Administrator Settings',
-                                 col2 => '',}],
+                                 col2 => 'Details',}],
                       print => \&print_rolecolors,
                       modify => \&modify_rolecolors,
                     },
@@ -333,7 +333,7 @@
                     { text => 'Log-in page options',
                       help => 'Domain_Configuration_Login_Page',
                       header => [{col1 => 'Log-in Page Items',
-                                  col2 => '',},
+                                  col2 => 'Settings',},
                                  {col1 => 'Log-in Help',
                                   col2 => 'Value'},
                                  {col1 => 'Custom HTML in document head',
@@ -482,7 +482,7 @@
                   { text => 'Bubblesheet format',
                     help => 'Domain_Configuration_Scantron_Format',
                     header => [ {col1 => 'Bubblesheet format file',
-                                 col2 => ''},
+                                 col2 => 'Action'},
                                 {col1 => 'Bubblesheet data upload formats',
                                  col2 => 'Settings'}],
                     print => \&print_scantron,
@@ -496,9 +496,9 @@
                              {col1 => 'Setting',
                               col2 => 'Value'},
                              {col1 => 'Available textbooks',
-                              col2 => ''},
+                              col2 => 'Details'},
                              {col1 => 'Available templates',
-                              col2 => ''},
+                              col2 => 'Details'},
                              {col1 => 'Validation (not official courses)',
                               col2 => 'Value'},],
                   print => \&print_quotas,
@@ -518,11 +518,11 @@
                   { text => 'Cataloging of courses/communities',
                     help => 'Domain_Configuration_Cataloging_Courses',
                     header => [{col1 => 'Catalog type/availability',
-                                col2 => '',},
+                                col2 => 'Setting',},
                                {col1 => 'Category settings for standard catalog',
-                                col2 => '',},
+                                col2 => 'Setting',},
                                {col1 => 'Categories',
-                                col2 => '',
+                                col2 => 'Details',
                                }],
                     print => \&print_coursecategories,
                     modify => \&modify_coursecategories,
@@ -987,8 +987,8 @@
            <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
-              <td class="LC_left_item'.$leftnobr.'"'.$colspan.'>'.&mt($item->{'header'}->[0]->{'col1'}).'</td>
-              <td class="LC_right_item"'.$rightcolspan.'>'.&mt($item->{'header'}->[0]->{'col2'}).'</td>
+              <th class="LC_left_item'.$leftnobr.'"'.$colspan.'>'.&mt($item->{'header'}->[0]->{'col1'}).'</th>
+              <th class="LC_right_item"'.$rightcolspan.'>'.&mt($item->{'header'}->[0]->{'col2'}).'</th>
              </tr>';
         $rowtotal ++;
         if (($action eq 'autoupdate') || ($action eq 'usercreation') || ($action eq 'selfcreation') ||
@@ -1024,8 +1024,8 @@
            <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
-              <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[1]->{'col1'}).'</td>
-              <td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[1]->{'col2'}).'</td>
+              <th class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[1]->{'col1'}).'</th>
+              <th class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[1]->{'col2'}).'</th>
              </tr>';
             $rowtotal ++;
         if (($action eq 'autoupdate') || ($action eq 'usercreation') ||
@@ -1050,8 +1050,8 @@
                           <td>
                           <table class="LC_nested">
                            <tr class="LC_info_row">
-                            <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</td>
-                            <td class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</td>
+                            <th class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</th>
+                            <th class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</th>
                            </tr>'."\n".
                            $item->{'print'}->('middle',$dom,$settings,\$rowtotal);
             } else {
@@ -1070,8 +1070,8 @@
            <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
-              <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[$trusthdrs[$i]]->{'col1'}).'</td>
-              <td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[$trusthdrs[$i]]->{'col2'}).'</td></tr>'.
+              <th class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[$trusthdrs[$i]]->{'col1'}).'</th>
+              <th class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[$trusthdrs[$i]]->{'col2'}).'</th></tr>'.
                            $item->{'print'}->($prefixes[$i],$dom,$settings,\$rowtotal).'
             </table>
           </td>
@@ -1082,8 +1082,8 @@
            <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
-              <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[8]->{'col1'}).'</td>
-              <td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[8]->{'col2'}).'</td></tr>'.
+              <th class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[8]->{'col1'}).'</th>
+              <th class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[8]->{'col2'}).'</th></tr>'.
                            $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
             } else {
                 my $hdridx = 2;
@@ -1098,8 +1098,8 @@
            <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
-              <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[$hdridx]->{'col1'}).'</td>
-              <td class="LC_right_item">'.&mt($item->{'header'}->[$hdridx]->{'col2'}).'</td>
+              <th class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[$hdridx]->{'col1'}).'</th>
+              <th class="LC_right_item">'.&mt($item->{'header'}->[$hdridx]->{'col2'}).'</th>
              </tr>'."\n";
                 if ($action eq 'coursecategories') {
                     $output .= &print_coursecategories('bottom',$dom,$item,$settings,\$rowtotal);
@@ -1112,7 +1112,6 @@
                     }
                     $hdridx ++;
                     $output .= '
-             </tr>
             </table>
            </td>
           </tr>
@@ -1120,18 +1119,13 @@
            <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
-              <td class="LC_left_item'.$leftnobr.'"'.$colspan.'>'.&mt($item->{'header'}->[$hdridx]->{'col1'}).'</td>
-              <td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[$hdridx]->{'col2'}).'</td></tr>'."\n";
+              <th class="LC_left_item'.$leftnobr.'"'.$colspan.'>'.&mt($item->{'header'}->[$hdridx]->{'col1'}).'</th>
+              <th class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[$hdridx]->{'col2'}).'</th></tr>'."\n";
                     if ($action eq 'passwords') {
                         $output .= $item->{'print'}->('bottom',$dom,$confname,$settings,\$rowtotal);
                     } else {
                         $output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
                     }
-                    $output .= '
-            </table>
-          </td>
-         </tr>
-         <tr>';
                 } else {
                     $output .= $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
                 }
@@ -1152,8 +1146,8 @@
            <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
-              <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</td>
-              <td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col2'}).'</td></tr>'.
+              <th class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</th>
+              <th class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col2'}).'</th></tr>'.
                            $item->{'print'}->('connfrom',$dom,$settings,\$rowtotal).'
             </table>
           </td>
@@ -1162,8 +1156,8 @@
            <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
-              <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col1'}).'</td>
-              <td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col2'}).'</td></tr>'.
+              <th class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col1'}).'</th>
+              <th class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col2'}).'</th></tr>'.
                            $item->{'print'}->('bottom',$dom,$settings,\$rowtotal);
         } elsif ($action eq 'login') {
             if ($numheaders == 5) {
@@ -1175,8 +1169,8 @@
            <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
-              <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</td>
-              <td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col2'}).'</td></tr>'.
+              <th class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</th>
+              <th class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col2'}).'</th></tr>'.
                        &print_login('help',$dom,$confname,$phase,$settings,\$rowtotal);
                 $rowtotal ++;
             } else {
@@ -1192,13 +1186,13 @@
              <tr class="LC_info_row">';
             if ($numheaders == 5) {
                 $output .= '
-              <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col1'}).'</td>
-              <td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col2'}).'</td>
+              <th class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col1'}).'</th>
+              <th class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col2'}).'</th>
              </tr>';
             } else {
                 $output .= '
-              <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</td>
-              <td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col2'}).'</td>
+              <th class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</th>
+              <th class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col2'}).'</th>
              </tr>';
             }
             $rowtotal ++;
@@ -1212,13 +1206,13 @@
              <tr class="LC_info_row">';
             if ($numheaders == 5) {
                 $output .= '
-              <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[4]->{'col1'}).'</td>
-              <td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[4]->{'col2'}).'</td>
+              <th class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[4]->{'col1'}).'</th>
+              <th class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[4]->{'col2'}).'</th>
              </tr>';
             } else {
                 $output .= '
-              <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col1'}).'</td>
-              <td class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col2'}).'</td>
+              <th class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col1'}).'</th>
+              <th class="LC_right_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col2'}).'</th>
              </tr>';
             }
             $rowtotal ++;
@@ -1234,8 +1228,8 @@
            <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
-              <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</td>
-              <td class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</td> </tr>'.
+              <th class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[2]->{'col1'}).'</th>
+              <th class="LC_right_item">'.&mt($item->{'header'}->[2]->{'col2'}).'</th> </tr>'.
                        &textbookcourses_javascript($settings).
                        &print_textbookcourses($dom,'textbooks',$settings,\$rowtotal).'
             </table>
@@ -1245,8 +1239,8 @@
            <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
-              <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col1'}).'</td>
-              <td class="LC_right_item">'.&mt($item->{'header'}->[3]->{'col2'}).'</td> </tr>'.
+              <th class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col1'}).'</th>
+              <th class="LC_right_item">'.&mt($item->{'header'}->[3]->{'col2'}).'</th> </tr>'.
                        &print_textbookcourses($dom,'templates',$settings,\$rowtotal).'
             </table>
            </td>
@@ -1255,8 +1249,8 @@
            <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
-              <td class="LC_left_item"'.$colspan.' style="vertical-align: top">'.&mt($item->{'header'}->[4]->{'col1'}).'</td>
-              <td class="LC_right_item" style="vertical-align: top">'.&mt($item->{'header'}->[4]->{'col2'}).'</td>
+              <th class="LC_left_item"'.$colspan.' style="vertical-align: top">'.&mt($item->{'header'}->[4]->{'col1'}).'</th>
+              <th class="LC_right_item" style="vertical-align: top">'.&mt($item->{'header'}->[4]->{'col2'}).'</th>
              </tr>'.
             &print_validation_rows('requestcourses',$dom,$settings,\$rowtotal);
         } elsif ($action eq 'requestauthor') {
@@ -1271,10 +1265,10 @@
            <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
-              <td class="LC_left_item"'.$colspan.' style="vertical-align: top">'.
-               &mt($item->{'header'}->[2]->{'col1'}).'</td>
-              <td class="LC_right_item" style="vertical-align: top">'.
-               &mt($item->{'header'}->[2]->{'col2'}).'</td>
+              <th class="LC_left_item"'.$colspan.' style="vertical-align: top">'.
+               &mt($item->{'header'}->[2]->{'col1'}).'</th>
+              <th class="LC_right_item" style="vertical-align: top">'.
+               &mt($item->{'header'}->[2]->{'col2'}).'</th>
              </tr>'.
             &print_rolecolors($phase,'author',$dom,$confname,$settings,\$rowtotal).'
            </table>
@@ -1284,8 +1278,8 @@
            <td>
             <table class="LC_nested">
              <tr class="LC_info_row">
-              <td class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col1'}).'</td>
-              <td class="LC_right_item">'.&mt($item->{'header'}->[3]->{'col2'}).'</td>
+              <th class="LC_left_item"'.$colspan.'>'.&mt($item->{'header'}->[3]->{'col1'}).'</th>
+              <th class="LC_right_item">'.&mt($item->{'header'}->[3]->{'col2'}).'</th>
              </tr>'.
             &print_rolecolors($phase,'admin',$dom,$confname,$settings,\$rowtotal);
             $rowtotal += 2;
@@ -1298,43 +1292,51 @@
              <tr class="LC_info_row">';
         if ($action eq 'login') {
             $output .= '  
-              <td class="LC_left_item" colspan="2">'.&mt($item->{'header'}->[0]->{'col1'}).'</td>';
+              <th class="LC_left_item" colspan="2">'.&mt($item->{'header'}->[0]->{'col1'}).'</th>';
         } elsif ($action eq 'serverstatuses') {
             $output .= '
-              <td class="LC_left_item" style="vertical-align: top">'.&mt($item->{'header'}->[0]->{'col1'}).
-              '<br />('.&mt('Automatic access for Dom. Coords.').')</td>';
+              <th class="LC_left_item" style="vertical-align: top">'.&mt($item->{'header'}->[0]->{'col1'}).
+              '<br />('.&mt('Automatic access for Dom. Coords.').')</th>';
 
         } else {
             $output .= '
-              <td class="LC_left_item" style="vertical-align: top">'.&mt($item->{'header'}->[0]->{'col1'}).'</td>';
+              <th class="LC_left_item" style="vertical-align: top">'.&mt($item->{'header'}->[0]->{'col1'}).'</th>';
         }
         if (defined($item->{'header'}->[0]->{'col3'})) {
-            $output .= '<td class="LC_left_item" style="vertical-align: top">'.
+            my $id;   
+            if ($action eq 'serverstatuses') {
+                $id = ' id="colheader2"';
+            }
+            $output .= '<th class="LC_left_item" style="vertical-align: top;"'.$id.'>'.
                        &mt($item->{'header'}->[0]->{'col2'});
             if ($action eq 'serverstatuses') {
                 $output .= '<br />(<tt>'.&mt('user1:domain1,user2:domain2 etc.').'</tt>)';
             } 
         } else {
-            $output .= '<td class="LC_right_item" style="vertical-align: top">'.
+            $output .= '<th class="LC_right_item" style="vertical-align: top">'.
                        &mt($item->{'header'}->[0]->{'col2'});
         }
-        $output .= '</td>';
+        $output .= '</th>';
         if ($item->{'header'}->[0]->{'col3'}) {
             if (defined($item->{'header'}->[0]->{'col4'})) {
-                $output .= '<td class="LC_left_item" style="vertical-align: top">'.
+                $output .= '<th class="LC_left_item" style="vertical-align: top">'.
                             &mt($item->{'header'}->[0]->{'col3'});
             } else {
-                $output .= '<td class="LC_right_item" style="vertical-align: top">'.
+                my $id;
+                if ($action eq 'serverstatuses') {
+                    $id = ' id="colheader3"';
+                }
+                $output .= '<th class="LC_right_item" style="vertical-align: top"'.$id.'>'.
                            &mt($item->{'header'}->[0]->{'col3'});
             }
             if ($action eq 'serverstatuses') {
                 $output .= '<br />(<tt>'.&mt('IP1,IP2 etc.').'</tt>)';
             }
-            $output .= '</td>';
+            $output .= '</th>';
         }
         if ($item->{'header'}->[0]->{'col4'}) {
-            $output .= '<td class="LC_right_item" style="vertical-align: top">'.
-                       &mt($item->{'header'}->[0]->{'col4'});
+            $output .= '<th class="LC_right_item" style="vertical-align: top">'.
+                       &mt($item->{'header'}->[0]->{'col4'}).'</th>';
         }
         $output .= '</tr>';
         $rowtotal ++;
@@ -1368,25 +1370,30 @@
         $css_class = ' class="LC_odd_row"';
         $datatable .= '<tr'.$css_class.'><td>'.$choice.'</td>'.
                       '<td style="text-align: right"><table><tr><th>'.$choices{'hostid'}.'</th>'.
-                      '<th>'.$choices{'server'}.'</th>'.
-                      '<th>'.$choices{'serverpath'}.'</th>'.
-                      '<th>'.$choices{'custompath'}.'</th>'.
-                      '<th><span class="LC_nobreak">'.$choices{'exempt'}.'</span></th></tr>'."\n";
+                      '<th id="login_service_redirect">'.$choices{'server'}.'</th>'.
+                      '<th id="login_service_path">'.$choices{'serverpath'}.'</th>'.
+                      '<th id="login_service_custompath">'.$choices{'custompath'}.'</th>'.
+                      '<th id="login_service_exempt"><span class="LC_nobreak">'.$choices{'exempt'}.'</span></th></tr>'."\n";
         my %disallowed;
         if (ref($settings) eq 'HASH') {
             if (ref($settings->{'loginvia'}) eq 'HASH') {
                %disallowed = %{$settings->{'loginvia'}};
             }
         }
+        my $service_rownum = 0;
         foreach my $lonhost (sort(keys(%servers))) {
+            $service_rownum ++;
             my $direct = 'selected="selected"';
             if (ref($disallowed{$lonhost}) eq 'HASH') {
                 if ($disallowed{$lonhost}{'server'} ne '') {
                     $direct = '';
                 }
             }
-            $datatable .= '<tr><td>'.$servers{$lonhost}.'</td>'.
-                          '<td><select name="'.$lonhost.'_server">'.
+            $datatable .= '<tr>'.
+                          '<th class="LC_rowheader" scope="row" id="login_service_server_'.$service_rownum.'">'.
+                          $servers{$lonhost}.'</th>'.
+                          '<td><select name="'.$lonhost.'_server" aria-labelledby="'.
+                          'login_service_server_'.$service_rownum.' login_service_redirect">'.
                           '<option value=""'.$direct.'>'.$choices{'directlogin'}.
                           '</option>';
             foreach my $hostid (sort(keys(%servers))) {
@@ -1401,7 +1408,8 @@
                               $servers{$hostid}.'</option>';
             }
             $datatable .= '</select></td>'.
-                          '<td><select name="'.$lonhost.'_serverpath">';
+                          '<td><select name="'.$lonhost.'_serverpath" aria-labelledby="'.
+                          'login_service_server_'.$service_rownum.' login_service_path">';
             foreach my $path ('','/','/adm/login','/adm/roles','custom') {
                 my $pathname = $path;
                 if ($path eq 'custom') {
@@ -1423,9 +1431,11 @@
                 $custom = $disallowed{$lonhost}{'custompath'};
                 $exempt = $disallowed{$lonhost}{'exempt'};
             }
-            $datatable .= '<td><input type="text" name="'.$lonhost.'_custompath" size="6" value="'.$custom.'" /></td>'.
-                          '<td><input type="text" name="'.$lonhost.'_exempt" size="8" value="'.$exempt.'" /></td>'.
-                          '</tr>';
+            $datatable .= '<td><input type="text" name="'.$lonhost.'_custompath" size="6" value="'.$custom.'" '.
+                          'aria-labelledby="login_service_server_'.$service_rownum.' login_service_custompath" /></td>'.
+                          '<td><input type="text" name="'.$lonhost.'_exempt" size="8" value="'.$exempt.'" '.
+                          'aria-labelledby="login_service_server_'.$service_rownum.' login_service_exempt" />'.
+                          '</td></tr>';
         }
         $datatable .= '</table></td></tr>';
         return $datatable;
@@ -1553,15 +1563,17 @@
             $datatable .=  
                 '<tr'.$css_class.'><td colspan="2">'.$choices{$item}.
                 '</td><td>'.
+                '<fieldset class="LC_borderless" style="line-height: 185%;">'.
+                '<legend class="LC_visually_hidden">'.$choices{$item}.'</legend>'.
                 '<span class="LC_nobreak"><label><input type="radio" name="'.
                 $item.'"'.$checkedon{$item}.' value="1" />'.&mt('Yes').
                 '</label> <label><input type="radio" name="'.$item.'"'.
-                $checkedoff{$item}.' value="0" />'.&mt('No').'</label></span></td>'.
+                $checkedoff{$item}.' value="0" />'.&mt('No').'</label></span></fieldset></td>'.
                 '</tr>';
             $itemcount ++;
         }
         $datatable .= &display_color_options($dom,$confname,$phase,'login',$itemcount,\%choices,\%is_custom,\%defaults,\%designs,\@images,\@bgs,\@links,\%alt_text,$rowtotal,\@logintext);
-        $datatable .= '</tr></table></td></tr>';
+	#        $datatable .= '</div></div></td></tr>';
     } elsif ($caller eq 'help') {
         my ($defaulturl,$defaulttype,%url,%type,%langchoices);
         my $itemcount = 1;
@@ -1587,6 +1599,7 @@
         foreach my $lang ('nolang',sort(@currlangs)) {
             $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
             $datatable .= '<tr'.$css_class.'>';
+            my $labeltext;
             if ($url{$lang} eq '') {
                 $url{$lang} = $defaulturl;
             }
@@ -1597,10 +1610,12 @@
             if ($lang eq 'nolang') {
                 $datatable .= &mt('Log-in help page if no specific language file: [_1]',
                                   &Apache::loncommon::modal_link($url{$lang},$lt{$type{$lang}},600,500));
+                $labeltext = &mt('Choose help file if no specific language');
             } else {
                 $datatable .= &mt('Log-in help page for language: [_1] is [_2]',
                                   $langchoices{$lang},
                                   &Apache::loncommon::modal_link($url{$lang},$lt{$type{$lang}},600,500));
+                $labeltext = &mt('Choose help file for language: [_1]',$langchoices{$lang}); 
             }
             $datatable .= '</span></td>'."\n".
                           '<td class="LC_left_item">';
@@ -1615,7 +1630,7 @@
             if ($switchserver) {
                 $datatable .= &mt('Upload to library server: [_1]',$switchserver);
             } else {
-                $datatable .= '<input type="file" name="loginhelpurl_'.$lang.'" />';
+                $datatable .= '<input type="file" name="loginhelpurl_'.$lang.'" aria-label="'.$labeltext.'" />';
             }
             $datatable .= '</td></tr>';
             $itemcount ++;
@@ -1631,13 +1646,15 @@
             $toadd{''} = &mt('Select');
             $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
             $datatable .= '<tr'.$css_class.'><td class="LC_left_item" colspan="2">'.
-                          &mt('Add log-in help page for a specific language:').' '.
-                          &Apache::loncommon::select_form('','loginhelpurl_add_lang',\%toadd).
+                          '<label for="loginhelpurl_add_lang">'.
+                          &mt('Add log-in help page for a specific language:').'</label> '.
+                          &Apache::loncommon::select_form('','loginhelpurl_add_lang',\%toadd,'','','loginhelpurl_add_lang').
                           '</td><td class="LC_left_item">'.$lt{'upl'}.'<br />';
+            my $arialabel = &mt('Choose log-in help page for added specific language');
             if ($switchserver) {
                 $datatable .= &mt('Upload to library server: [_1]',$switchserver);
             } else {
-                $datatable .= '<input type="file" name="loginhelpurl_add_file" />';
+                $datatable .= '<input type="file" name="loginhelpurl_add_file"  aria-label="'.$arialabel.'" />';
             }
             $datatable .= '</td></tr>';
             $itemcount ++;
@@ -1650,8 +1667,8 @@
         $datatable .= '<tr'.$css_class.'><td colspan="2">'.$choice.'</td>'.
                       '<td style="text-align: left"><table><tr><th>'.$choices{'hostid'}.'</th>'.
                       '<th>'.$choices{'current'}.'</th>'.
-                      '<th>'.$choices{'action'}.'</th>'.
-                      '<th>'.$choices{'exempt'}.'</th></tr>'."\n";
+                      '<th id="login_headtag_action">'.$choices{'action'}.'</th>'.
+                      '<th id="login_headtag_exempt">'.$choices{'exempt'}.'</th></tr>'."\n";
         my (%currurls,%currexempt);
         if (ref($settings) eq 'HASH') {
             if (ref($settings->{'headtag'}) eq 'HASH') {
@@ -1663,9 +1680,12 @@
                 }
             }
         }
+        my $headtag_rownum = 0;
         foreach my $lonhost (sort(keys(%domservers))) {
+            $headtag_rownum ++;
             my $exempt = &check_exempt_addresses($currexempt{$lonhost});
-            $datatable .= '<tr><td>'.$domservers{$lonhost}.'</td>';
+            $datatable .= '<tr><th id="login_headtag_server_'.$headtag_rownum.'" class="LC_rowheader" scope="row">'.
+                          $domservers{$lonhost}.'</th>';
             if ($currurls{$lonhost}) {
                 $datatable .= '<td class="LC_right_item"><a href="'.
                               "javascript:void(open('$currurls{$lonhost}?inhibitmenu=yes','Custom_HeadTag',
@@ -1681,9 +1701,9 @@
             if ($switchserver) {
                 $datatable .= &mt('Upload to library server: [_1]',$switchserver);
             } else {
-                $datatable .= '<input type="file" name="loginheadtag_'.$lonhost.'" />';
+                $datatable .= '<input type="file" name="loginheadtag_'.$lonhost.'" aria-labelledby="login_headtag_action login_headtag_server_'.$headtag_rownum.'" />';
             }
-            $datatable .= '</td><td><input type="text" name="loginheadtagexempt_'.$lonhost.'" value="'.$exempt.'" /></td></tr>';
+            $datatable .= '</td><td><input type="text" name="loginheadtagexempt_'.$lonhost.'" value="'.$exempt.'" aria-labelledby="login_headtag_exempt login_headtag_server_'.$headtag_rownum.'" /></td></tr>';
         }
         $datatable .= '</table></td></tr>';
     } elsif ($caller eq 'saml') {
@@ -1695,7 +1715,7 @@
         my (%saml,%samltext,%samlimg,%samlalt,%samlurl,%samltitle,%samlwindow,%samlnotsso,%styleon,%styleoff);
         foreach my $lonhost (keys(%domservers)) {
             $samlurl{$lonhost} = '/adm/sso';
-            $styleon{$lonhost} = 'display:none';
+            $styleon{$lonhost} = 'display: none;';
             $styleoff{$lonhost} = '';
         }
         if ((ref($settings) eq 'HASH') && (ref($settings->{'saml'}) eq 'HASH')) {
@@ -1710,9 +1730,9 @@
                     $samlwindow{$lonhost} = $settings->{'saml'}{$lonhost}{'window'};
                     $samlnotsso{$lonhost} = $settings->{'saml'}{$lonhost}{'notsso'};
                     $styleon{$lonhost} = '';
-                    $styleoff{$lonhost} = 'display:none';
+                    $styleoff{$lonhost} = 'display: none;';
                 } else {
-                    $styleon{$lonhost} = 'display:none';
+                    $styleon{$lonhost} = 'display: none;';
                     $styleoff{$lonhost} = '';
                 }
             }
@@ -1733,18 +1753,22 @@
             }
             my $css_class = $itemcount%2?' class="LC_odd_row"':'';
             $datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'.$domservers{$lonhost}.'</span></td>'.
-                          '<td><span class="LC_nobreak"><label><input type="radio" name="saml_'.$lonhost.'"'.$samloff.
+                          '<td><fieldset class="LC_borderless">'.
+                          '<legend class="LC_virtually_hidden">'.&mt('Dual login for [_1]?',$domservers{$lonhost}).
+                          '</legend>'.
+                          '<span class="LC_nobreak"><label><input type="radio" name="saml_'.$lonhost.'"'.$samloff.
                           'onclick="toggleSamlOptions(this.form,'."'$lonhost'".');" value="0" />'.
                           &mt('No').'</label>'.(' 'x2).
                           '<label><input type="radio" name="saml_'.$lonhost.'"'.$samlon.
                           'onclick="toggleSamlOptions(this.form,'."'$lonhost'".');" value="1" />'.
-                          &mt('Yes').'</label></span></td>'.
+                          &mt('Yes').'</label></span></fieldset></td>'.
                           '<td id="samloptionson_'.$lonhost.'" style="'.$styleon{$lonhost}.'" width="100%">'.
                           '<table width="100%"><tr><th colspan="3" align="center">'.&mt('SSO').'</th></tr>'.
                           '<tr><th>'.&mt('Text').'</th><th>'.&mt('Image').'</th>'.
                           '<th>'.&mt('Alt Text').'</th></tr>'.
                           '<tr'.$css_class.'><td><input type="text" name="saml_text_'.$lonhost.'" size="20" value="'.
-                          $samltext{$lonhost}.'" /></td><td>';
+                          $samltext{$lonhost}.'" aria-label="'.
+                          &mt("Text to display when state is 'SSO login' for [_1]",$domservers{$lonhost}).'" /></td><td>';
             if ($samlimg{$lonhost}) {
                 $datatable .= '<img src="'.$samlimg{$lonhost}.'" /><br />'.
                               '<span class="LC_nobreak"><label>'.
@@ -1757,26 +1781,34 @@
             if ($switchserver) {
                 $datatable .= &mt('Upload to library server: [_1]',$switchserver);
             } else {
-                $datatable .= '<input type="file" name="saml_img_'.$lonhost.'" />';
+                $datatable .= '<input type="file" name="saml_img_'.$lonhost.'" aria-label="'.
+                              &mt('Choose image file for SSO login button for [_1]',$domservers{$lonhost}).'" />';
             }
             $datatable .= '</td>'.
                           '<td><input type="text" name="saml_alt_'.$lonhost.'" size="25" '.
-                          'value="'.$samlalt{$lonhost}.'" /></td></tr></table><br />'.
+                          'value="'.$samlalt{$lonhost}.'" aria-label="'.
+                          &mt('alt text for SSO login button image for [_1]',$domservers{$lonhost}).'" />'.
+                          '</td></tr></table><br />'.
                           '<table width="100%"><tr><th colspan="3" align="center">'.&mt('SSO').'</th><th align="center">'.
                           '<span class="LC_nobreak">'.&mt('Non-SSO').'</span></th></tr>'.
                           '<tr><th>'.&mt('URL').'</th><th>'.&mt('Tool Tip').'</th>'.
                           '<th>'.&mt('Pop-up if iframe').'</th><th>'.&mt('Text').'</th></tr>'.
                           '<tr'.$css_class.'>'.
                           '<td><input type="text" name="saml_url_'.$lonhost.'" size="30" '.
-                          'value="'.$samlurl{$lonhost}.'" /></td>'.
-                          '<td><textarea name="saml_title_'.$lonhost.'" rows="3" cols="20">'.
+                          'value="'.$samlurl{$lonhost}.'" aria-label="'.
+                          &mt('URL to load when SSO Login button pushed for [_1]',$domservers{$lonhost}).'" /></td>'.
+                          '<td><textarea name="saml_title_'.$lonhost.'" rows="3" cols="20" aria-label="'.
+			  &mt('Text to display when user hovers over SSO Login button for [_1]',$domservers{$lonhost}).'">'.
                           $samltitle{$lonhost}.'</textarea></td>'.
-                          '<td><label><input type="radio" name="saml_window_'.$lonhost.'" value=""'.$samlwinoff.'>'.
-                          &mt('No').'</label>'.(' 'x2).'<label><input type="radio" '.
-                          'name="saml_window_'.$lonhost.'" value="1"'.$samlwinon.'>'.&mt('Yes').'</label></td>'.
+                          '<td><fieldset class="LC_borderless">'.
+                          '<legend class="LC_visually_hidden">'.&mt('Pop-up if iframe').'</legend>'.
+                          '<span class="LC_nobreak"><label><input type="radio" name="saml_window_'.$lonhost.'" value=""'.$samlwinoff.' />'.
+                          &mt('No').'</label></span>'.(' 'x2).' <span class="LC_nobreak"><label><input type="radio" '.
+                          'name="saml_window_'.$lonhost.'" value="1"'.$samlwinon.' />'.&mt('Yes').'</label></span></fieldset></td>'.
                           '<td><input type="text" name="saml_notsso_'.$lonhost.'" size="12" '.
-                          'value="'.$samlnotsso{$lonhost}.'" /></td></tr>'.
-                          '</table></td>'.
+                          'value="'.$samlnotsso{$lonhost}.'" aria-label="'.
+                          &mt("Text to display when state is not 'SSO login' for [_1]",$domservers{$lonhost}).'" />'.
+                          '</td></tr></table></td>'.
                           '<td id="samloptionsoff_'.$lonhost.'" style="'.$styleoff{$lonhost}.'" width="100%"> </td></tr>';
            $itemcount ++;
         }
@@ -1871,8 +1903,9 @@
                 }
             }
             my $chgstr = ' onchange="javascript:reorderIPaccess(this.form,'."'ipaccess_pos_".$item."'".');"';
+            my $labeltext = &mt('Set list order for existing access control');
             $datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">'
-                         .'<select name="ipaccess_pos_'.$item.'"'.$chgstr.'>';
+                         .'<select name="ipaccess_pos_'.$item.'"'.$chgstr.' aria=label="'.$labeltext.'">';
             for (my $k=0; $k<=$maxnum; $k++) {
                 my $vpos = $k+1;
                 my $selstr;
@@ -1892,9 +1925,10 @@
     }
     $css_class = $itemcount%2?' class="LC_odd_row"':'';
     my $chgstr = ' onchange="javascript:reorderIPaccess(this.form,'."'ipaccess_pos_add'".');"';
+    my $arialabel = &mt('Set list order for new access control');
     $datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">'."\n".
                   '<input type="hidden" name="ipaccess_maxnum" value="'.$maxnum.'" />'."\n".
-                  '<select name="ipaccess_pos_add"'.$chgstr.'>';
+                  '<select name="ipaccess_pos_add"'.$chgstr.' aria-label="'.$arialabel.'">';
     for (my $k=0; $k<$maxnum+1; $k++) {
         my $vpos = $k+1;
         my $selstr;
@@ -1904,7 +1938,7 @@
         $datatable .= '<option value="'.$k.'"'.$selstr.'>'.$vpos.'</option>';
     }
     $datatable .= '</select> '."\n".
-                  '<input type="checkbox" name="ipaccess_add" value="1" />'.&mt('Add').'</span></td>'."\n".
+                  '<label><input type="checkbox" name="ipaccess_add" value="1" />'.&mt('Add').'</label></span></td>'."\n".
                   '<td colspan="2">'.
                   &ipaccess_options('add',$itemcount,$dom).
                   '</td>'."\n".
@@ -1922,32 +1956,44 @@
     if (ref($coursesref) eq 'HASH') {
         %currcourses = %{$coursesref};
     }
-    $output = '<fieldset><legend>'.&mt('Location(s)').'</legend>'.
-              '<span class="LC_nobreak">'.&mt('Name').': '.
-              '<input type="text" name="ipaccess_name_'.$num.'" value="'.$name.'" />'.
+    my %lt = &Apache::lonlocal::texthash (
+        loc => 'Location(s)',
+        ips => 'IP Range(s)',
+        fun => 'Functionality Blocked?',
+        coa => 'Courses/Communities allowed',
+        use => 'use Select link',
+        add => 'Add a Course or Community for which access is allowed',
+        for => 'Format for each IP range',
+        ran => 'Range(s) will be stored as IP netblock(s) in CIDR notation (comma separated)',   
+    );
+    $output = '<fieldset><legend>'.$lt{'loc'}.'</legend>'.
+              '<span class="LC_nobreak"><label>'.&mt('Name').': '.
+              '<input type="text" name="ipaccess_name_'.$num.'" value="'.$name.'" /></label>'.
               '</span></fieldset>'.
-              '<fieldset><legend>'.&mt('IP Range(s)').'</legend>'.
-              &mt('Format for each IP range').': '.&mt('A.B.C.D/N or A.B.C.D-E.F.G.H').'<br />'.
-              &mt('Range(s) will be stored as IP netblock(s) in CIDR notation (comma separated)').'<br />'.
-              '<textarea name="ipaccess_range_'.$num.'" rows="3" cols="80">'.
+              '<fieldset><legend>'.$lt{'ips'}.'</legend>'.
+              $lt{'for'}.': '.&mt('[_1] or [_2]','A.B.C.D/N','A.B.C.D-E.F.G.H').'<br />'.
+              $lt{'ran'}.'<br />'.
+              '<textarea name="ipaccess_range_'.$num.'" rows="3" cols="80" aria-label="'.$lt{'ips'}.'">'.
               $ipranges.'</textarea></fieldset>'.
-              '<fieldset><legend>'.&mt('Functionality Blocked?').'</legend>'.
+              '<fieldset><legend>'.$lt{'fun'}.'</legend>'.
               &blocker_checkboxes($num,$blocksref).'</fieldset>'.
-              '<fieldset><legend>'.&mt('Courses/Communities allowed').'</legend>'.
-              '<table>';
+              '<fieldset><legend>'.$lt{'coa'}.'</legend>'.
+              '<div class="LC_grid" role="grid">';
     foreach my $cid (sort(keys(%currcourses))) {
         my %courseinfo = &Apache::lonnet::coursedescription($cid,{'one_time' => 1});
-        $output .= '<tr><td><span class="LC_nobreak">'.
+        $output .= '<div class="LC_grid_row" role="row">'.
+                   '<div class="LC_grid_cell" role"gridcell"><span class="LC_nobreak">'.
                    '<label><input type="checkbox" name="ipaccess_course_delete_'.$num.'" value="'.$cid.'" />'.
                    &mt('Delete?').' <span class="LC_cusr_emph">'.$courseinfo{'description'}.'</span></label></span>'.
-                   ' <span class="LC_fontsize_medium">('.$cid.')</span></td></tr>';
+                   ' <span class="LC_fontsize_medium">('.$cid.')</span></div></div>';
     }
-    $output .= '<tr><td><span class="LC_nobreak">'.&mt('Add').': '.
-               '<input type="text" name="ipaccess_cdesc_'.$num.'" value="" onfocus="this.blur();opencrsbrowser('."'display','ipaccess_cnum_$num','ipaccess_cdom_$num','ipaccess_cdesc_$num'".');" />'.
+    $output .= '<div class="LC_grid_row" role="row">'.
+               '<div class="LC_grid_cell" role="gridcell"><span class="LC_nobreak">'.&mt('Add').': '.
+               '<input type="text" name="ipaccess_cdesc_'.$num.'" value="" readonly="readonly" placeholder="'.$lt{'use'}.'" aria-label="'.$lt{'add'}.'" />'.
                 &Apache::loncommon::selectcourse_link('display','ipaccess_cnum_'.$num,'ipaccess_cdom_'.$num,'ipaccess_cdesc_'.$num,$dom,undef,'Course/Community').
                '<input type="hidden" name="ipaccess_cnum_'.$num.'" value="" />'.
                '<input type="hidden" name="ipaccess_cdom_'.$num.'" value="" />'.
-               '</span></td></tr></table>'."\n".
+               '</span></div></div></div>'."\n".
                '</fieldset>';
     return $output;
 }
@@ -1956,7 +2002,7 @@
     my ($num,$blocks) = @_;
     my ($typeorder,$types) = &commblocktype_text();
     my $numinrow = 6;
-    my $output = '<table>';
+    my $output = '<div class="LC_grid" role="grid">';
     for (my $i=0; $i<@{$typeorder}; $i++) {
         my $block = $typeorder->[$i];
         my $blockstatus;
@@ -1968,20 +2014,11 @@
         my $rem = $i%($numinrow);
         if ($rem == 0) {
             if ($i > 0) {
-                $output .= '</tr>';
+                $output .= '</div>';
             }
-            $output .= '<tr>';
-        }
-        if ($i == scalar(@{$typeorder})-1) {
-            my $colsleft = $numinrow-$rem;
-            if ($colsleft > 1) {
-                $output .= '<td colspan="'.$colsleft.'">';
-            } else {
-                $output .= '<td>';
-            }
-        } else {
-            $output .= '<td>';
+            $output .= '<div class="LC_grid_row" role="row">';
         }
+        $output .= '<div class="LC_grid_cell" role="gridcell">';
         my $item = 'ipaccess_block_'.$num;
         if ($blockstatus) {
             $blockstatus = ' '.$blockstatus;
@@ -1990,9 +2027,9 @@
                    '<input type="checkbox" name="'.$item.'"'.
                    $blockstatus.' value="'.$block.'"'.' />'.
                    $types->{$block}.'</label></span>'."\n".
-                   '<br /></td>';
+                   '<br /></div>';
     }
-    $output .= '</tr></table>';
+    $output .= '</div></div>';
     return $output;
 }
 
@@ -2088,7 +2125,7 @@
     }
     my $itemcount = 1;
     my $datatable = &display_color_options($dom,$confname,$phase,$role,$itemcount,\%choices,\%is_custom,\%defaults,\%designs,\@images,\@bgs,\@links,\%alt_text,$rowtotal,'',\@alerts);
-    $datatable .= '</tr></table></td></tr>';
+    $datatable .= '</div></div></td></tr>';
     return $datatable;
 }
 
@@ -2140,7 +2177,7 @@
     my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'};
     my $css_class = $itemcount%2?' class="LC_odd_row"':'';
     my $datatable = '<tr'.$css_class.'>'.
-        '<td>'.$choices->{'font'}.'</td>';
+        '<td><label for="'.$role.'_font">'.$choices->{'font'}.'</label></td>';
     if (!$is_custom->{'font'}) {
         $datatable .=  '<td>'.&mt('Default in use:').' <span class="css_default_'.$role.'_font" style="color: '.$defaults->{'font'}.';">'.$defaults->{'font'}.'</span></td>';
     } else {
@@ -2149,12 +2186,12 @@
     my $current_color = $designs->{'font'} ? $designs->{'font'} : $defaults->{'font'};
 
     $datatable .= '<td><span class="LC_nobreak">'.
-                  '<input type="text" class="colorchooser" size="10" name="'.$role.'_font"'.
+                  '<input type="text" class="colorchooser" size="10" name="'.$role.'_font" id="'.$role.'_font"'.
                   ' value="'.$current_color.'" /> '.
                   ' </span></td></tr>';
     unless ($role eq 'login') { 
         $datatable .= '<tr'.$css_class.'>'.
-                      '<td>'.$choices->{'fontmenu'}.'</td>';
+                      '<td><label for="'.$role.'_fontmenu">'.$choices->{'fontmenu'}.'</label></td>';
         if (!$is_custom->{'fontmenu'}) {
             $datatable .=  '<td>'.&mt('Default in use:').' <span class="css_default_'.$role.'_font" style="color: '.$defaults->{'fontmenu'}.';">'.$defaults->{'fontmenu'}.'</span></td>';
         } else {
@@ -2164,7 +2201,7 @@
 	    $designs->{'fontmenu'} : $defaults->{'fontmenu'};
         $datatable .= '<td><span class="LC_nobreak">'.
                       '<input class="colorchooser" type="text" size="10" name="'
-		      .$role.'_fontmenu"'.
+		      .$role.'_fontmenu" id="'.$role.'_fontmenu"'.
                       ' value="'.$current_color.'" /> '.
                       ' </span></td></tr>';
     }
@@ -2198,8 +2235,9 @@
         } else {
             $imgfile = $defaults->{$img};
         }
+        my $showfile;
         if ($imgfile) {
-            my ($showfile,$fullsize);
+            my $fullsize;
             if ($imgfile =~ m-^(/res/\Q$dom\E/\Q$confname\E/\Q$img\E)/([^/]+)$-) {
                 my $urldir = $1;
                 my $filename = $2;
@@ -2277,7 +2315,14 @@
             $datatable .= &mt('Upload to library server: [_1]',$switchserver);
         } else {
             if ($img ne 'login') { # suppress file selection for Log-in header
-                $datatable .=' <input type="file" name="'.$role.'_'.$img.'" />';
+                my $arialabel = &mt('Choose image file for [_1]',$choices->{$img});
+                if ($showfile) {
+                    $datatable .= '<div style="display: inline-block; margin: 4px 0 0 0;">';
+                }
+                $datatable .=' <input type="file" name="'.$role.'_'.$img.'" aria-label="'.$arialabel.'" />';
+                if ($showfile) {
+                    $datatable .= '</div>';
+                }
             }
         }
         if (($role eq 'login') && ($img ne 'login')) {
@@ -2294,27 +2339,34 @@
     my $bgs_def;
     foreach my $item (@{$bgs}) {
         if (!$is_custom->{$item}) {
-            $bgs_def .= '<td><span class="LC_nobreak">'.$choices->{$item}.'</span> <span class="css_default_'.$role.'_'.$item.'" style="background-color: '.$defaults->{'bgs'}{$item}.';">   </span><br />'.$defaults->{'bgs'}{$item}.'</td>';
+            $bgs_def .= '<div class="LC_grid_cell" role="gridcell" style="margin: 0;">'.
+                        '<span class="LC_nobreak">'.$choices->{$item}.'</span> '.
+			'<span class="css_default_'.$role.'_'.$item.'" style="background-color: '.$defaults->{'bgs'}{$item}.';">   </span><br />'.$defaults->{'bgs'}{$item}.'</div>';
         }
     }
     if ($bgs_def) {
-        $datatable .= '<td>'.&mt('Default(s) in use:').'<br /><table border="0"><tr>'.$bgs_def.'</tr></table></td>';
+        $datatable .= '<td>'.&mt('Default(s) in use:').'<br />'.
+                      '<div class="LC_grid" role="grid" style="margin: 0;">'.
+                      '<div class="LC_grid_row" role="row">'.
+		      $bgs_def.
+		      '</div></div></td>';
     } else {
         $datatable .= '<td> </td>';
     }
     $datatable .= '<td class="LC_right_item">'.
-                  '<table border="0"><tr>';
-
+                  '<div class="LC_grid" role="grid" style="margin: 0;">'.
+                  '<div class="LC_grid_row" role="row">';
     foreach my $item (@{$bgs}) {
-        $datatable .= '<td style="text-align: center">'.$choices->{$item};
+        $datatable .= '<div class="LC_grid_cell" role="gridcell" style="text-align: center">'.
+                      '<label for="'.$role.'_'.$item.'">'.$choices->{$item}.'</label>';
 	my $color = $designs->{'bgs'}{$item} ? $designs->{'bgs'}{$item} : $defaults->{'bgs'}{$item};
         if ($designs->{'bgs'}{$item}) {
             $datatable .= ' ';
         }
         $datatable .= '<br /><input type="text" class="colorchooser" size="8" name="'.$role.'_'.$item.'" value="'.$color.
-                      '" onblur = "javascript:colchg_span('."'css_".$role.'_'.$item."'".',this);" /></td>';
+                      '" id="'.$role.'_'.$item.'" onblur = "javascript:colchg_span('."'css_".$role.'_'.$item."'".',this);" /></div>';
     }
-    $datatable .= '</tr></table></td></tr>';
+    $datatable .= '</div></div></td></tr>';
     $itemcount ++;
     $css_class = $itemcount%2?' class="LC_odd_row"':'';
     $datatable .= '<tr'.$css_class.'>'.
@@ -2322,51 +2374,64 @@
     my $links_def;
     foreach my $item (@{$links}) {
         if (!$is_custom->{$item}) {
-            $links_def .= '<td>'.$choices->{$item}.'<br /><span class="css_default_'.$role.'_'.$item.'" style="color: '.$defaults->{'links'}{$item}.';">'.$defaults->{'links'}{$item}.'</span></td>';
+            $links_def .= '<div class="LC_grid_cell" role="gridcell">'.$choices->{$item}.'<br /><span class="css_default_'.$role.'_'.$item.'" style="color: '.$defaults->{'links'}{$item}.';">'.$defaults->{'links'}{$item}.'</span></div>';
         }
     }
     if ($links_def) {
-        $datatable .= '<td>'.&mt('Default(s) in use:').'<br /><table border="0"><tr>'.$links_def.'</tr></table></td>';
+        $datatable .= '<td>'.&mt('Default(s) in use:').'<br />'.
+                      '<div class="LC_grid" role="grid" style="margin: 0;">'.
+		      '<div class="LC_grid_row" role="row">'.$links_def.'</div></div></td>';
     } else {
         $datatable .= '<td> </td>';
     }
     $datatable .= '<td class="LC_right_item">'.
-                  '<table border="0"><tr>';
+                  '<div class="LC_grid" role="grid" style="margin: 0;">'.
+                  '<div class="LC_grid_row" role="row">';
     foreach my $item (@{$links}) {
 	my $color = $designs->{'links'}{$item} ? $designs->{'links'}{$item} : $defaults->{'links'}{$item};
-        $datatable .= '<td style="text-align: center">'.$choices->{$item}."\n";
+        $datatable .= '<div class="LC_grid_cell" role="gridcell" style="text-align: center">'.
+                      '<label for="'.$role.'_'.$item.'">'.$choices->{$item}.'</label>'."\n";
         if ($designs->{'links'}{$item}) {
             $datatable.=' ';
         }
-        $datatable .= '<br /><input type="text" size="8" class="colorchooser" name="'.$role.'_'.$item.'" value="'.$color.
-                      '" /></td>';
+        $datatable .= '<br /><input type="text" size="8" class="colorchooser" name="'.$role.'_'.$item.'" id="'.$role.'_'.$item.'" value="'.$color.
+                      '" /></div>';
     }
-    $datatable .= '</tr></table></td></tr>';
+    $datatable .= '</div></div></td></tr>';
     $itemcount ++;
     $css_class = $itemcount%2?' class="LC_odd_row"':'';
-    $datatable .= '<tr'.$css_class.'>'.
-                  '<td>'.$choices->{'alerts'}.'</td>';
-    my $alerts_def;
-    foreach my $item (@{$alerts}) {
-        if (!$is_custom->{$item}) {
-            $alerts_def .= '<td>'.$choices->{$item}.'<br /><span class="css_default_'.$role.'_'.$item.'" style="color: '.$defaults->{'alerts'}{$item}.';">'.$defaults->{'alerts'}{$item}.'</span></td>';
+    unless ($role eq 'login') {
+        $datatable .= '<tr'.$css_class.'>'.
+                      '<td>'.$choices->{'alerts'}.'</td>';
+        my $alerts_def;
+        foreach my $item (@{$alerts}) {
+            if (!$is_custom->{$item}) {
+                $alerts_def .= '<div class="LC_grid_cell" role="gridcell">'.$choices->{$item}.'<br />'.
+                               '<span class="css_default_'.$role.'_'.$item.'" style="color: '.$defaults->{'alerts'}{$item}.';">'.
+                               $defaults->{'alerts'}{$item}.'</span></div>';
+            }
         }
-    }
-    if ($alerts_def) {
-        $datatable .= '<td>'.&mt('Default(s) in use:').'<br /><table border="0"><tr>'.$alerts_def.'</tr></table></td>';
-    } else {
-        $datatable .= '<td> </td>';
-    }
-    $datatable .= '<td class="LC_right_item">'.
-                  '<table border="0"><tr>';
-    foreach my $item (@{$alerts}) {
-        my $color = $designs->{'alerts'}{$item} ? $designs->{'alerts'}{$item} : $defaults->{'alerts'}{$item};
-        $datatable .= '<td style="text-align: center">'.$choices->{$item}."\n";
-        if ($designs->{'alerts'}{$item}) {
-            $datatable.=' ';
+        if ($alerts_def) {
+            $datatable .= '<td>'.&mt('Default(s) in use:').'<br />'.
+                          '<div class="LC_grid" role="grid" style="margin: 0;">'.
+		          '<div class="LC_grid_row" role="row">'.$alerts_def.'</div></div></td>';
+        } else {
+            $datatable .= '<td> </td>';
+        }
+        $datatable .= '<td class="LC_right_item">'.
+                      '<div class="LC_grid" role="grid" style="margin: 0;">'.
+		      '<div class="LC_grid_row" role="row">';
+        foreach my $item (@{$alerts}) {
+            my $color = $designs->{'alerts'}{$item} ? $designs->{'alerts'}{$item} : $defaults->{'alerts'}{$item};
+            $datatable .= '<div class="LC_grid_cell" role="gridcell" style="text-align: center">'.
+                          '<label for="'.$role.'_'.$item.'">'.$choices->{$item}.'</label>'."\n";
+            if ($designs->{'alerts'}{$item}) {
+                $datatable.=' ';
+            }
+            my $labeltext = &mt('[_1] color for [_2]',$choices->{'alerts'},$choices->{$item});
+            $datatable .= '<br /><input type="text" size="8" class="colorchooser" name="'.$role.'_'.$item.'" '.
+	                  'id="'.$role.'_'.$item.'" value="'.$color.'" aria-label="'.$labeltext.'" /></div>';
         }
-        $datatable .= '<br /><input type="text" size="8" class="colorchooser" name="'.$role.'_'.$item.'" value="'.$color.
-                      '" /></td>';
     }
     $itemcount ++;
     $$rowtotal += $itemcount;
@@ -2421,14 +2486,14 @@
 
 sub login_text_colors {
     my ($img,$role,$logintext,$phase,$choices,$designs,$defaults) = @_;
-    my $color_menu = '<table border="0"><tr>';
+    my $color_menu = '<div class="LC_grid" role="grid"><div class="LC_grid_row" role="row">';
     foreach my $item (@{$logintext}) {
-        $color_menu .= '<td style="text-align: center">'.$choices->{$item};
+        $color_menu .= '<div class="LC_grid_cell" role="gridcell" style="text-align: center"><label>'.$choices->{$item};
         my $color = $designs->{'logintext'}{$item} ? $designs->{'logintext'}{$item} : $defaults->{'logintext'}{$item};
         $color_menu .= '<br /><input type="text" class="colorchooser" size="8" name="'.$role.'_'.$item.'" value="'.$color.
-                      '" onblur = "javascript:colchg_span('."'css_".$role.'_'.$item."'".',this);" /></td>';
+                      '" onblur = "javascript:colchg_span('."'css_".$role.'_'.$item."'".',this);" /></label></div>';
     }
-    $color_menu .= '</tr></table><br />';
+    $color_menu .= '</div></div><br />';
     return $color_menu;
 }
 
@@ -2508,6 +2573,15 @@
                               '<td class="LC_left_item">';
                 if ($context eq 'requestcourses') {
                     $datatable .= '<table><tr>';
+                } else {
+                    my $legend;
+                    if ($context eq 'requestauthor') {
+                        $legend = &mt('Handling authoring requests from [_1]',$usertypes->{$type});
+                    } else {
+                        $legend = &mt('Tools available for [_1]',$usertypes->{$type});
+                    }
+                    $datatable .= '<fieldset class="LC_borderless" style="line-height: 185%;">'.
+                                  '<legend class="LC_visually_hidden">'.$legend.'</legend>';
                 }
                 my %cell;  
                 foreach my $item (@usertools) {
@@ -2517,7 +2591,7 @@
                             if (ref($settings->{$item}) eq 'HASH') {
                                 $curroption = $settings->{$item}->{$type};
                                 if ($curroption =~ /^autolimit=(\d*)$/) {
-                                    $currlimit = $1; 
+                                    $currlimit = $1;
                                 }
                             }
                         }
@@ -2525,6 +2599,10 @@
                             $curroption = 'norequest';
                         }
                         $datatable .= '<th>'.$titles{$item}.'</th>';
+                        my $legend = &mt('Request for course type [_1] by user type: [_2]',
+			                 $titles{$item},$usertypes->{$type});
+			$cell{$item} = '<fieldset class="LC_borderless" style="line-height: 185%;">'.
+                                       '<legend class="LC_visually_hidden">'.$legend.'</legend>';
                         foreach my $option (@options) {
                             my $val = $option;
                             if ($option eq 'norequest') {
@@ -2552,15 +2630,18 @@
                                   '_'.$type.'" value="'.$val.'"'.$checked.' />'.
                                   $titles{$option}.'</label>';
                             if ($option eq 'autolimit') {
+                                my $arialabel = &mt('Total course requests (type: [_1]) per user ([_2])',
+                                                    $titles{$item},$usertypes->{$type});
                                 $cell{$item} .= ' <input type="text" name="crsreq_'.
                                                 $item.'_limit_'.$type.'" size="1" '.
-                                                'value="'.$currlimit.'" />';
+                                                'value="'.$currlimit.'" aria-label="'.$arialabel.'" />';
                             }
                             $cell{$item} .= '</span> ';
                             if ($option eq 'autolimit') {
                                 $cell{$item} .= $titles{'unlimited'};
                             }
                         }
+                        $cell{$item} .= '</fieldset>';
                     } elsif ($context eq 'requestauthor') {
                         my $curroption;
                         if (ref($settings) eq 'HASH') {
@@ -2609,16 +2690,19 @@
                         $datatable .= '<td style="vertical-align: top">'.$cell{$item}.'</td>';  
                     }
                     $datatable .= '</tr></table>';
+                } else {
+                    $datatable .= '</fieldset>';
                 }
                 $datatable .= '</td>';
                 unless (($context eq 'requestcourses') ||
                         ($context eq 'requestauthor')) {
+                    my $labeltext = &mt('Quota for [_1]',$usertypes->{$type});
                     $datatable .= 
                               '<td class="LC_right_item">'.
                               '<span class="LC_nobreak">'.
                               '<input type="text" name="quota_'.$type.
                               '" value="'.$currdefquota.
-                              '" size="5" /></span></td>';
+                              '" size="5" aria-label="'.$labeltext.'" /></span></td>';
                 }
                 $datatable .= '</tr>';
             }
@@ -2641,6 +2725,15 @@
                   '<td class="LC_left_item">';
     if ($context eq 'requestcourses') {
         $datatable .= '<table><tr>';
+    } else {
+        my $legend;
+        if ($context eq 'requestauthor') {
+            $legend = &mt('Handling authoring requests from [_1]',$othertitle);
+        } else {
+            $legend = &mt('Tools available for [_1]',$othertitle);
+        }
+        $datatable .= '<fieldset class="LC_borderless" style="line-height: 185%;">'.
+                      '<legend class="LC_visually_hidden">'.$legend.'</legend>';
     }
     my %defcell;
     foreach my $item (@usertools) {
@@ -2658,6 +2751,10 @@
                 $curroption = 'norequest';
             }
             $datatable .= '<th>'.$titles{$item}.'</th>';
+            my $legend = &mt('Request for course type [_1] by user type: [_2]',
+                             $titles{$item},$othertitle);
+            $defcell{$item} = '<fieldset class="LC_borderless" style="line-height: 185%;">'.
+                              '<legend class="LC_visually_hidden">'.$legend.'</legend>';
             foreach my $option (@options) {
                 my $val = $option;
                 if ($option eq 'norequest') {
@@ -2685,15 +2782,18 @@
                                   '_default" value="'.$val.'"'.$checked.' />'.
                                   $titles{$option}.'</label>';
                 if ($option eq 'autolimit') {
+                    my $arialabel = &mt('Total course requests (type: [_1]) per user ([_2])',
+                                        $titles{$item},$othertitle);
                     $defcell{$item} .= ' <input type="text" name="crsreq_'.
                                        $item.'_limit_default" size="1" '.
-                                       'value="'.$currlimit.'" />';
+                                       'value="'.$currlimit.'" aria-label="'.$arialabel.'" />';
                 }
                 $defcell{$item} .= '</span> ';
                 if ($option eq 'autolimit') {
                     $defcell{$item} .= $titles{'unlimited'};
                 }
             }
+            $defcell{$item} .= '</fieldset>';
         } elsif ($context eq 'requestauthor') {
             my $curroption;
             if (ref($settings) eq 'HASH') {
@@ -2742,13 +2842,16 @@
             $datatable .= '<td style="vertical-align: top">'.$defcell{$item}.'</td>';
         }
         $datatable .= '</tr></table>';
+    } else {
+        $datatable .= '</fieldset>';
     }
     $datatable .= '</td>';
     unless (($context eq 'requestcourses') || ($context eq 'requestauthor')) {
+        my $labeltext = &mt('Quota for [_1]',$othertitle);
         $datatable .= '<td class="LC_right_item">'.
                       '<span class="LC_nobreak">'.
                       '<input type="text" name="defaultquota" value="'.
-                      $defaultquota.'" size="5" /></span></td>';
+                      $defaultquota.'" size="5" aria-label="'.$labeltext.'" /></span></td>';
     }
     $datatable .= '</tr>';
     $typecount ++;
@@ -2765,6 +2868,14 @@
                       '</td>'.
                       '<td class="LC_left_item" colspan="2">'.
                       '<br />';
+        my $legend;
+        if ($context eq 'requestauthor') {
+            $legend = &mt('Handling authoring requests from LON-CAPA Advanced Users');
+        } else {
+            $legend = &mt('Tools available for LON-CAPA Advanced Users');
+        }
+        $datatable .= '<fieldset class="LC_borderless" style="line-height: 185%;">'.
+                      '<legend class="LC_visually_hidden">'.$legend.'</legend>'; 
     }
     my %advcell;
     foreach my $item (@usertools) {
@@ -2779,6 +2890,10 @@
                 }
             }
             $datatable .= '<th>'.$titles{$item}.'</th>';
+            my $legend = &mt('Request for course type [_1] (advanced user override)',
+                             $titles{$item});
+            $advcell{$item} = '<fieldset class="LC_borderless" style="line-height: 185%;">'.
+                              '<legend class="LC_visually_hidden">'.$legend.'</legend>';
             my $checked = '';
             if ($curroption eq '') {
                 $checked = ' checked="checked"';
@@ -2814,15 +2929,18 @@
                                   '__LC_adv" value="'.$val.'"'.$checked.' />'.
                                   $titles{$option}.'</label>';
                 if ($option eq 'autolimit') {
+                    my $arialabel = &mt('Total course requests (type: [_1]) per user (advanced user override)',
+                                        $titles{$item});
                     $advcell{$item} .= ' <input type="text" name="crsreq_'.
                                        $item.'_limit__LC_adv" size="1" '.
-                                       'value="'.$currlimit.'" />';
+                                       'value="'.$currlimit.'" aria-label="'.$arialabel.'" />';
                 }
                 $advcell{$item} .= '</span> ';
                 if ($option eq 'autolimit') {
                     $advcell{$item} .= $titles{'unlimited'};
                 }
             }
+            $advcell{$item} .= '</fieldset>';
         } elsif ($context eq 'requestauthor') {
             my $curroption;
             if (ref($settings) eq 'HASH') {
@@ -2876,6 +2994,8 @@
             $datatable .= '<td style="vertical-align: top">'.$advcell{$item}.'</td>';
         }
         $datatable .= '</tr></table>';
+    } else {
+        $datatable .= '</fieldset>';
     }
     $datatable .= '</td></tr>';
     $$rowtotal += $typecount;
@@ -2917,10 +3037,10 @@
        $text = &mt('Receive notification of queued requests for self-created user accounts requiring approval');
     }
     $datatable = '<tr'.$css_class.'>'.
-                 ' <td>'.$text.'</td>'.
-                 ' <td class="LC_left_item">';
+                 '<td>'.$text.'</td>'.
+                 '<td class="LC_left_item">';
     my ($numdc,$table,$rows) = &active_dc_picker($dom,$numinrow,'checkbox',
-                                                 $action.'notifyapproval',%currapp);
+                                                 $action.'notifyapproval',$text,%currapp);
     if ($numdc > 0) {
         $datatable .= $table;
     } else {
@@ -2942,9 +3062,13 @@
             }
         }
     }
-    $output .= '<tr>'.
-               '<td class="LC_left_item">'.&mt('Generate unique six character code as course identifier?').'</td>'.
-               '<td class="LC_left_item">';
+    my $title = &mt('Generate unique six character code as course identifier?');
+    my $css_class = $$rowtotal%2?' class="LC_odd_row"':'';
+    $output .= '<tr'.$css_class.'>'.
+               '<td class="LC_left_item">'.$title.'</td>'.
+               '<td class="LC_left_item">'.
+               '<fieldset class="LC_borderless">'.
+               '<legend class="LC_visually_hidden">'.$title.'</legend>';
     foreach my $type (@crstypes) {
         my $check = ' ';
         if ($current{$type}) {
@@ -2954,7 +3078,7 @@
                    '<input type="checkbox" name="uniquecode" value="'.$type.'"'.$check.'/>'.
                    &mt($type).'</label></span>'.(' 'x2).' ';
     }
-    $output .= '</td></tr>';
+    $output .= '</fieldset></td></tr>';
     $$rowtotal ++;
     return $output;
 }
@@ -3018,15 +3142,15 @@
             $datatable .= '</select>'.(' 'x2).
                 '<label><input type="checkbox" name="'.$type.'_del" value="'.$key.'" />'.
                 &mt('Delete?').'</label></span></td>'.
-                '<td colspan="2">'.
-                '<span class="LC_nobreak">'.&mt('Subject:').'<input type="text" size="15" name="'.$type.'_subject_'.$i.'" value="'.$subject.'" /></span> '.
+                '<td colspan="2" style="line-height: 200%;">'.
+                '<span class="LC_nobreak"><label>'.&mt('Subject:').'<input type="text" size="15" name="'.$type.'_subject_'.$i.'" value="'.$subject.'" /></label></span> '.
                 (' 'x2).
-                '<span class="LC_nobreak">'.&mt('Title:').'<input type="text" size="30" name="'.$type.'_title_'.$i.'" value="'.$title.'" /></span> ';
+                '<span class="LC_nobreak"><label>'.&mt('Title:').'<input type="text" size="30" name="'.$type.'_title_'.$i.'" value="'.$title.'" /></label></span> ';
             if ($type eq 'textbooks') {
                 $datatable .= (' 'x2).
-                              '<span class="LC_nobreak">'.&mt('Publisher:').'<input type="text" size="10" name="'.$type.'_publisher_'.$i.'" value="'.$publisher.'" /></span> '.
+                              '<span class="LC_nobreak"><label>'.&mt('Publisher:').'<input type="text" size="10" name="'.$type.'_publisher_'.$i.'" value="'.$publisher.'" /></label></span> '.
                               (' 'x2).
-                              '<span class="LC_nobreak">'.&mt('Author(s):').'<input type="text" size="25" name="'.$type.'_author_'.$i.'" value="'.$author.'" /></span> '.
+                              '<span class="LC_nobreak"><label>'.&mt('Author(s):').'<input type="text" size="25" name="'.$type.'_author_'.$i.'" value="'.$author.'" /></label></span> '.
                               (' 'x2).
                               '<span class="LC_nobreak">'.&mt('Thumbnail:');
                 if ($image) {
@@ -3038,7 +3162,8 @@
                 if ($switchserver) {
                     $datatable .= &mt('Upload to library server: [_1]',$switchserver);
                 } else {
-                    $datatable .= '<input type="file" name="'.$type.'_image_'.$i.'" value="" />';
+                    my $arialabel = &mt('Select image file to upload'); 
+                    $datatable .= '<input type="file" name="'.$type.'_image_'.$i.'" value="" aria-label="'.$arialabel.'" />';
                 }
             }
             $datatable .= '<input type="hidden" name="'.$type.'_id_'.$i.'" value="'.$type.'_'.$key.'" /></span> '.
@@ -3049,9 +3174,10 @@
     }
     $css_class = $itemcount%2?' class="LC_odd_row"':'';
     my $chgstr = ' onchange="javascript:reorderBooks(this.form,'."'$type"."_addbook_pos','$type'".');"';
-    $datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">'."\n".
+    my $labeltext = &mt('Set list order -- type: [_1]',$type);
+    $datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'."\n".
                   '<input type="hidden" name="'.$type.'_maxnum" value="'.$maxnum.'" />'."\n".
-                  '<select name="'.$type.'_addbook_pos"'.$chgstr.'>';
+                  '<select name="'.$type.'_addbook_pos"'.$chgstr.' aria-label="'.$labeltext.'">';
     for (my $k=0; $k<$maxnum+1; $k++) {
         my $vpos = $k+1;
         my $selstr;
@@ -3061,30 +3187,32 @@
         $datatable .= '<option value="'.$k.'"'.$selstr.'>'.$vpos.'</option>';
     }
     $datatable .= '</select> '."\n".
-                  '<input type="checkbox" name="'.$type.'_addbook" value="1" />'.&mt('Add').'</span></td>'."\n".
-                  '<td colspan="2">'.
-                  '<span class="LC_nobreak">'.&mt('Subject:').'<input type="text" size="15" name="'.$type.'_addbook_subject" value="" /></span> '."\n".
+                  '<label><input type="checkbox" name="'.$type.'_addbook" value="1" />'.&mt('Add').'</label></span></td>'."\n".
+                  '<td colspan="2" style="line-height: 200%;">'.
+                  '<span class="LC_nobreak"><label>'.&mt('Subject:').'<input type="text" size="15" name="'.$type.'_addbook_subject" value="" /></label></span> '."\n".
                   (' 'x2).
-                  '<span class="LC_nobreak">'.&mt('Title:').'<input type="text" size="30" name="'.$type.'_addbook_title" value="" /></span> '."\n".
+                  '<span class="LC_nobreak"><label>'.&mt('Title:').'<input type="text" size="30" name="'.$type.'_addbook_title" value="" /></label></span> '."\n".
                   (' 'x2);
     if ($type eq 'textbooks') {
-        $datatable .= '<span class="LC_nobreak">'.&mt('Publisher:').'<input type="text" size="10" name="'.$type.'_addbook_publisher" value="" /></span> '."\n".
+        $datatable .= '<span class="LC_nobreak"><label>'.&mt('Publisher:').'<input type="text" size="10" name="'.$type.'_addbook_publisher" value="" /></label></span> '."\n".
                       (' 'x2).
-                      '<span class="LC_nobreak">'.&mt('Author(s):').'<input type="text" size="25" name="'.$type.'_addbook_author" value="" /></span> '."\n".
+                      '<span class="LC_nobreak"><label>'.&mt('Author(s):').'<input type="text" size="25" name="'.$type.'_addbook_author" value="" /></label></span> '."\n".
                       (' 'x2).
                       '<span class="LC_nobreak">'.&mt('Image:').' ';
         if ($switchserver) {
             $datatable .= &mt('Upload to library server: [_1]',$switchserver);
         } else {
-            $datatable .= '<input type="file" name="'.$type.'_addbook_image" value="" />';
+            my $arialabel = &mt('Select image file to upload');
+            $datatable .= '<input type="file" name="'.$type.'_addbook_image" value="" aria-label="'.$arialabel.'" />';
         }
         $datatable .= '</span>'."\n";
     }
-    $datatable .= '<span class="LC_nobreak">'.&mt('LON-CAPA course:').' '.
-                  &Apache::loncommon::select_dom_form($env{'request.role.domain'},$type.'_addbook_cdom').
-                  '<input type="text" size="25" name="'.$type.'_addbook_cnum" value="" />'.
+    $datatable .= '<span class="LC_nobreak"><label for="'.$type.'_addbook_cnum">'.&mt('LON-CAPA course').'</label> '.
+                  '<span class="LC_visually_hidden"><label for="'.$type.'_addbook_cdom">'.&mt('(in domain)').'</label></span>:'.
+                  &Apache::loncommon::select_dom_form($env{'request.role.domain'},$type.'_addbook_cdom','','','','','','',$type.'_addbook_cdom').
+                  '<input type="text" size="25" name="'.$type.'_addbook_cnum" id="'.$type.'_addbook_cnum" value="" />'.
                   &Apache::loncommon::selectcourse_link
-                      ('display',$type.'_addbook_cnum',$type.'_addbook_cdom',undef,undef,undef,'Course').
+                      ('display',$type.'_addbook_cnum',$type.'_addbook_cdom',undef,undef,undef,'Course','','',$type.'_addbook_cnum').
                   '</span></td>'."\n".
                   '</tr>'."\n";
     $itemcount ++;
@@ -4110,43 +4238,60 @@
             $runon = ' ';
         }
     }
-    my $domform = &Apache::loncommon::select_dom_form($defdom,'sender_domain',1);
+    my $domform = &Apache::loncommon::select_dom_form($defdom,'sender_domain',1,
+                                                      '','','','','','sender_domain');
     my $notif_sender;
     if (ref($settings) eq 'HASH') {
         $notif_sender = $settings->{'sender_uname'};
     }
+    my %lt = &Apache::lonlocal::texthash(
+        act => 'Auto-enrollment active?',
+        not => 'Notification messages - sender',
+        aco => 'Automatically assign co-ownership',
+        fai => 'Failsafe for no drops when institutional data missing',
+        thr => 'Threshold for number of students in section to drop'
+    );
     my $datatable='<tr class="LC_odd_row">'.
-                  '<td>'.&mt('Auto-enrollment active?').'</td>'.
-                  '<td class="LC_right_item"><span class="LC_nobreak"><label>'.
+                  '<td style="line-height: 170%;">'.$lt{'act'}.'</td>'.
+                  '<td class="LC_right_item">'.
+                  '<fieldset class="LC_borderless">'.
+                  '<legend class="LC_visually_hidden">'.$lt{'act'}.'</legend>'.
+                  '<span class="LC_nobreak"><label>'.
                   '<input type="radio" name="autoenroll_run"'.
                   $runon.' value="1" />'.&mt('Yes').'</label> '.
                   '<label><input type="radio" name="autoenroll_run"'.
-                  $runoff.' value="0" />'.&mt('No').'</label></span></td>'.
+                  $runoff.' value="0" />'.&mt('No').'</label></span>'.
+                  '</fieldset></td>'.
                   '</tr><tr>'.
-                  '<td>'.&mt('Notification messages - sender').
-                  '</td><td class="LC_right_item"><span class="LC_nobreak">'.
+                  '<td style="line-height: 170%;">'.$lt{'not'}.'</td>'.
+                  '<td class="LC_right_item"><span class="LC_nobreak"><label>'.
                   &mt('username').': '.
                   '<input type="text" name="sender_uname" value="'.
-                  $notif_sender.'" size="10" />  '.&mt('domain').
+                  $notif_sender.'" size="10" /></label>  '.
+                  '<label for="sender_domain">'.&mt('domain').'</label>'.
                   ': '.$domform.'</span></td></tr>'.
                   '<tr class="LC_odd_row">'.
-                  '<td>'.&mt('Automatically assign co-ownership').'</td>'.
-                  '<td class="LC_right_item"><span class="LC_nobreak"><label>'.
+                  '<td style="line-height: 170%;">'.$lt{'aco'}.'</td>'.
+                  '<td class="LC_right_item">'.
+                  '<fieldset class="LC_borderless">'.
+                  '<legend class="LC_visually_hidden">'.$lt{'aco'}.'</legend>'.
+		  '<span class="LC_nobreak"><label>'.
                   '<input type="radio" name="autoassign_coowners"'.
                   $coownerson.' value="1" />'.&mt('Yes').'</label> '.
                   '<label><input type="radio" name="autoassign_coowners"'.
-                  $coownersoff.' value="0" />'.&mt('No').'</label></span></td>'.
-                  '</tr><tr>'.
-                  '<td>'.&mt('Failsafe for no drops when institutional data missing').'</td>'.
-                  '<td class="LC_left_item"><span class="LC_nobreak">'.
+                  $coownersoff.' value="0" />'.&mt('No').'</label></span>'.
+                  '</fieldset></td></tr>'.
+                  '<tr><td>'.$lt{'fai'}.'</td>'.
+                  '<td class="LC_left_item">'.
+		  '<fieldset class="LC_borderless" style="line-height: 185%;">'.
+                  '<legend class="LC_visually_hidden">'.$lt{'fai'}.'</legend>'.
                   '<span class="LC_nobreak"><label><input type="radio" name="autoenroll_failsafe" value="off" onclick="toggleFailsafe(this.form)"'.$failsafechecked{'off'}.' />'.&mt('Not in use').'</label></span>    '.
                   '<span class="LC_nobreak"><label><input type="radio" name="autoenroll_failsafe" value="zero" onclick="toggleFailsafe(this.form)"'.$failsafechecked{'zero'}.' />'.&mt('Retrieved section enrollment is zero').'</label></span><br />'.
                   '<span class="LC_nobreak"><label><input type="radio" name="autoenroll_failsafe" value="any" onclick="toggleFailsafe(this.form)"'.$failsafechecked{'any'}.' />'.&mt('Retrieved section enrollment is zero or greater').'</label></span>'.
                   '<div class="LC_floatleft" style="display:'.$failsafesty.';" id="autoenroll_failsafe_div">'.
-                  '<span class="LC_nobreak">'.
-                  &mt('Threshold for number of students in section to drop: [_1]',
-                      '<input type="text" name="autoenroll_autofailsafe" value="'.$autofailsafe.'" size="4" />').
-                  '</span></div></td></tr>';
+                  '<span class="LC_nobreak"><label>'.$lt{'thr'}.': '.
+                  '<input type="text" name="autoenroll_autofailsafe" value="'.$autofailsafe.'" size="4" />'.
+                  '</label></span></div></fieldset></td></tr>';
     $$rowtotal += 4;
     return $datatable;
 }
@@ -4171,12 +4316,15 @@
             }
         }
         $enable = '<tr class="LC_odd_row">'.
-                  '<td>'.$choices{'run'}.'</td>'.
-                  '<td class="LC_left_item"><span class="LC_nobreak"><label>'.
+                  '<td style="line-height: 170%;">'.$choices{'run'}.'</td>'.
+                  '<td class="LC_left_item">'.
+                  '<fieldset class="LC_borderless">'.
+                  '<legend class="LC_visually_hidden">'.$choices{'run'}.'</legend>'.
+                  '<span class="LC_nobreak"><label>'.
                   '<input type="radio" name="autoupdate_run"'.
                   $updateoff.'value="0" />'.&mt('No').'</label> '.
                   '<label><input type="radio" name="autoupdate_run"'.
-                  $updateon.'value="1" />'.&mt('Yes').'</label></span></td>'.
+                  $updateon.'value="1" />'.&mt('Yes').'</label></span></fieldset></td>'.
                   '</tr>';
         my @toggles = ('classlists','unexpired');
         my %defaultchecked = ('classlists' => 'off',
@@ -4202,18 +4350,22 @@
         }
         my $css_class = $itemcount%2?' class="LC_odd_row"':'';
         $datatable .= '<tr'.$css_class.'>'.
-                      '<td>'.$choices{'lastactive'}.'</td>'.
-                      '<td class="LC_left_item"><span class="LC_nobreak"><label>'.
+                      '<td style="line-height: 170%;">'.$choices{'lastactive'}.'</td>'.
+                      '<td class="LC_left_item">'.
+                      '<fieldset class="LC_borderless">'.
+                      '<legend class="LC_visually_hidden">'.$choices{'lastactive'}.'</legend>'.
+                      '<span class="LC_nobreak"><label>'.
                       '<input type="radio" name="lastactive"'.
                       $lastactiveoff.'value="0"'.$onclick.' />'.&mt('No').'</label>'.
-                      ' <label>'.
+                      ' </span><label>'.
                       '<input type="radio" name="lastactive"'.
                       $lastactiveon.' value="1"'.$onclick.' />'.&mt('Yes').'</label>'.
                       '<div id="lastactive_div" style="display:'.$lastactivestyle.';">'.
+                      '<span class="LC_nobreak">'.
                       ': '.&mt('inactive = no activity in last [_1] days',
                           '<input type="text" size="5" name="lastactivedays" value="'.
-                          $lastactivedays.'" />').
-                      '</span></td>'.
+                          $lastactivedays.'" aria-label="'.&mt('threshold for inactivity (days)').'" />').
+                      '</span></div></fieldset></td>'.
                       '</tr>';
         $$rowtotal ++;
     } elsif ($position eq 'middle') {
@@ -4273,22 +4425,32 @@
     }
     $$rowtotal += 2;
     my $numinrow = 2;
+    my %lt = &Apache::lonlocal::texthash(
+                 crxm => 'Create pending official courses from XML files',
+                 crof => 'Create pending requests for official courses (if validated)',
+    );       
     my $datatable='<tr class="LC_odd_row">'.
-                  '<td>'.&mt('Create pending official courses from XML files').'</td>'.
-                  '<td class="LC_right_item"><span class="LC_nobreak"><label>'.
+                  '<td style="line-height: 170%;">'.$lt{'crxm'}.'</td>'.
+                  '<td class="LC_right_item"><fieldset class="LC_borderless">'.
+                  '<legend class="LC_visually_hidden">'.$lt{'crxm'}.'</legend>'.
+                  '<span class="LC_nobreak"><label>'.
                   '<input type="radio" name="autocreate_xml"'.
                   $createon{'xml'}.' value="1" />'.&mt('Yes').'</label> '.
                   '<label><input type="radio" name="autocreate_xml"'.
                   $createoff{'xml'}.' value="0" />'.&mt('No').'</label></span>'.
-                  '</td></tr><tr>'.
-                  '<td>'.&mt('Create pending requests for official courses (if validated)').'</td>'.
-                  '<td class="LC_right_item"><span class="LC_nobreak"><label>'.
+                  '</fieldset></td></tr><tr>'.
+                  '<td style="line-height: 170%;">'.$lt{'crof'}.'</td>'.
+                  '<td class="LC_right_item"><fieldset class="LC_borderless">'.
+                  '<legend class="LC_visually_hidden">'.$lt{'crof'}.'</legend>'.
+                  '<span class="LC_nobreak"><label>'.
                   '<input type="radio" name="autocreate_req"'.
                   $createon{'req'}.' value="1" />'.&mt('Yes').'</label> '.
                   '<label><input type="radio" name="autocreate_req"'.
-                  $createoff{'req'}.' value="0" />'.&mt('No').'</label></span>';
+                  $createoff{'req'}.' value="0" />'.&mt('No').'</label></span>'.
+                  '</fieldset>';
+    my $legend = &mt('Choose Dom. Coord. who will be listed as course creator');
     my ($numdc,$dctable,$rows) = &active_dc_picker($dom,$numinrow,'radio',
-                                                   'autocreate_xmldc',%currhash);
+                                                   'autocreate_xmldc',$legend,%currhash);
     $datatable .= '</td></tr><tr class="LC_odd_row"><td>';
     if ($numdc > 1) {
         $datatable .= &mt('Course creation processed as: (choose Dom. Coord.)').
@@ -4346,20 +4508,34 @@
 
         my $numinrow = 4;
         my $cansrchrow = 0;
+        my %lt = &Apache::lonlocal::texthash(
+                     indi => 'Institutional directory search available?',
+                     othe => 'Other domains can search institution?',
+                     supp => 'Supported search methods',
+                     lati => 'Search latitude',
+        );
         $datatable='<tr class="LC_odd_row">'.
-                   '<td colspan="2"><span class ="LC_nobreak">'.&mt('Institutional directory search available?').'</span></td>'.
-                   '<td class="LC_right_item"><span class="LC_nobreak"><label>'.
+                   '<td colspan="2" style="line-height: 170%;">'.
+                   '<span class ="LC_nobreak">'.$lt{'indi'}.'</span></td>'.
+                   '<td class="LC_right_item">'.
+                   '<fieldset class="LC_borderless">'.
+                   '<legend class="LC_visually_hidden">'.$lt{'indi'}.'</legend>'.
+                   '<span class="LC_nobreak"><label>'.
                    '<input type="radio" name="dirsrch_available"'.
                    $instsrchon.' value="1" />'.&mt('Yes').'</label> '.
                    '<label><input type="radio" name="dirsrch_available"'.
-                   $instsrchoff.' value="0" />'.&mt('No').'</label></span></td>'.
+                   $instsrchoff.' value="0" />'.&mt('No').'</label></span></fieldset></td>'.
                    '</tr><tr>'.
-                   '<td colspan="2"><span class ="LC_nobreak">'.&mt('Other domains can search institution?').'</span></td>'.
-                   '<td class="LC_right_item"><span class="LC_nobreak"><label>'.
+                   '<td colspan="2" style="line-height: 170%;">'.
+                   '<span class ="LC_nobreak">'.$lt{'othe'}.'</span></td>'.
+                   '<td class="LC_right_item">'.
+                   '<fieldset class="LC_borderless">'.
+                   '<legend class="LC_visually_hidden">'.$lt{'othe'}.'</legend>'.
+                   '<span class="LC_nobreak"><label>'.
                    '<input type="radio" name="dirsrch_instlocalonly"'.
                    $instlocaloff.' value="0" />'.&mt('Yes').'</label> '.
                    '<label><input type="radio" name="dirsrch_instlocalonly"'.
-                   $instlocalon.' value="1" />'.&mt('No').'</label></span></td>'.
+                   $instlocalon.' value="1" />'.&mt('No').'</label></span></fieldset></td>'.
                    '</tr>';
         $$rowtotal += 2;
         if (ref($usertypes) eq 'HASH') {
@@ -4376,8 +4552,12 @@
         } else {
             $datatable .= '<tr class="LC_odd_row">';
         }
-        $datatable .= '<td><span class ="LC_nobreak">'.&mt('Supported search methods').
-                      '</span></td><td class="LC_left_item" colspan="2"><table><tr>';
+        $datatable .= '<td><span class ="LC_nobreak">'.$lt{'supp'}.'</span></td>'.
+                      '<td class="LC_left_item" colspan="2">'.
+                      '<fieldset class="LC_borderless">'.
+                      '<legend class="LC_visually_hidden">'.$lt{'supp'}.'</legend>'.
+                      '<div class="LC_grid" role="grid">'.
+                      '<div class="LC_grid_row" role="row">';
         foreach my $title (@{$titleorder}) {
             if (defined($searchtitles->{$title})) {
                 my $check = ' ';
@@ -4388,22 +4568,25 @@
                         }
                     }
                 }
-                $datatable .= '<td class="LC_left_item">'.
+                $datatable .= '<div class="LC_grid_cell" role="gridcell">'.
                               '<span class="LC_nobreak"><label>'.
                               '<input type="checkbox" name="searchby" '.
                               'value="'.$title.'"'.$check.'/>'.
-                              $searchtitles->{$title}.'</label></span></td>';
+                              $searchtitles->{$title}.'</label></span></div>';
             }
         }
-        $datatable .= '</tr></table></td></tr>';
+        $datatable .= '</div></div></fieldset></td></tr>';
         $$rowtotal ++;
         if ($cansrchrow) {
             $datatable .= '<tr class="LC_odd_row">';
         } else {
             $datatable .= '<tr>';
         }
-        $datatable .= '<td><span class ="LC_nobreak">'.&mt('Search latitude').'</span></td>'.   
+        $datatable .= '<td style="line-height: 170%;">'.
+                      '<span class="LC_nobreak">'.$lt{'lati'}.'</span></td>'.   
                       '<td class="LC_left_item" colspan="2">'.
+                      '<fieldset class="LC_borderless">'.
+                      '<legend class="LC_visually_hidden">'.$lt{'lati'}.'</legend>'.
                       '<span class="LC_nobreak"><label>'.
                       '<input type="checkbox" name="searchtypes" '.
                       $exacton.' value="exact" />'.&mt('Exact match').
@@ -4413,13 +4596,17 @@
                       '</label> '.
                       '<label><input type="checkbox" name="searchtypes" '.
                       $containson.' value="contains" />'.&mt('Contains').
-                      '</label></span></td></tr>';
+                      '</label></span></fieldset></td></tr>';
         $$rowtotal ++;
     } else {
         my $domsrchon = ' checked="checked" ';
         my $domsrchoff = ' ';
         my $domlocalon = ' ';
         my $domlocaloff = ' checked="checked" ';
+        my %lt = &Apache::lonlocal::texthash(
+                     lcdi => 'LON-CAPA directory search available',
+                     olcd => 'Other domains can search LON-CAPA domain?',
+        );
         if (ref($settings) eq 'HASH') {
             if ($settings->{'lclocalonly'} eq '1') {
                 $domlocalon = $domlocaloff;
@@ -4431,19 +4618,25 @@
             }
         }
         $datatable='<tr class="LC_odd_row">'.
-                      '<td colspan="2"><span class ="LC_nobreak">'.&mt('LON-CAPA directory search available?').'</span></td>'.
-                      '<td class="LC_right_item"><span class="LC_nobreak"><label>'.
+                      '<td colspan="2"><span class ="LC_nobreak">'.$lt{'lcdi'}.'</span></td>'.
+                      '<td class="LC_right_item">'.
+                      '<fieldset class="LC_borderless" style="line-height: 170%;">'.
+                      '<legend class="LC_visually_hidden">'.$lt{'lcdi'}.'</legend>'.
+                      '<span class="LC_nobreak"><label>'.
                       '<input type="radio" name="dirsrch_domavailable"'.
                       $domsrchon.' value="1" />'.&mt('Yes').'</label> '.
                       '<label><input type="radio" name="dirsrch_domavailable"'.
-                      $domsrchoff.' value="0" />'.&mt('No').'</label></span></td>'.
+                      $domsrchoff.' value="0" />'.&mt('No').'</label></span></fieldset></td>'.
                       '</tr><tr>'.
-                      '<td colspan="2"><span class ="LC_nobreak">'.&mt('Other domains can search LON-CAPA domain?').'</span></td>'.
-                      '<td class="LC_right_item"><span class="LC_nobreak"><label>'.
+                      '<td colspan="2"><span class ="LC_nobreak">'.$lt{'olcd'}.'</span></td>'.
+                      '<td class="LC_right_item">'.
+                      '<fieldset class="LC_borderless" style="line-height: 170%;">'.
+                      '<legend class="LC_visually_hidden">'.$lt{'olcd'}.'</legend>'.
+                      '<span class="LC_nobreak"><label>'.
                       '<input type="radio" name="dirsrch_domlocalonly"'.
                       $domlocaloff.' value="0" />'.&mt('Yes').'</label> '.
                       '<label><input type="radio" name="dirsrch_domlocalonly"'.
-                      $domlocalon.' value="1" />'.&mt('No').'</label></span></td>'.
+                      $domlocalon.' value="1" />'.&mt('No').'</label></span></fieldset></td>'.
                       '</tr>';
         $$rowtotal += 2;
     }
@@ -4568,9 +4761,9 @@
         foreach my $item (@contacts) {
             $css_class = $rownum%2?' class="LC_odd_row"':'';
             $datatable .= '<tr'.$css_class.'>'. 
-                          '<td><span class="LC_nobreak">'.$titles->{$item}.
+                          '<td><span class="LC_nobreak"><label for="'.$item.'">'.$titles->{$item}.'</label>'.
                           '</span></td><td class="LC_right_item">'.
-                          '<input type="text" name="'.$item.'" value="'.
+                          '<input type="text" name="'.$item.'" id="'.$item.'" value="'.
                           $to{$item}.'" /></td></tr>';
             $rownum ++;
         }
@@ -4584,16 +4777,23 @@
             (ref($fieldoptions) eq 'HASH') && (ref($possoptions) eq 'HASH')) {
             $datatable .= '<table><tr><th>'.&mt('Field').'</th><th>'.&mt('Status').'</th></tr>';
             foreach my $field (@{$fields}) {
-                $datatable .= '<tr><td>'.$fieldtitles->{$field};
+                $datatable .= '<tr><td><span aria-hidden="true" style="line-height: 170%;">'.
+                              $fieldtitles->{$field};
                 if (($field eq 'screenshot') || ($field eq 'cc')) {
                     $datatable .= ' '.&mt('(logged-in users)');
                 }
-                $datatable .='</td><td>';
+                $datatable .='</span></td><td>';
                 my $clickaction;
                 if ($field eq 'screenshot') {
                     $clickaction = ' onclick="screenshotSize(this);"';
                 }
                 if (ref($possoptions->{$field}) eq 'ARRAY') {
+                    $datatable .= '<fieldset class="LC_borderless">'.
+                                  '<legend class="LC_visually_hidden">'.$fieldtitles->{$field};
+                    if (($field eq 'screenshot') || ($field eq 'cc')) {
+                        $datatable .= ' '.&mt('(logged-in users)');
+                    }
+                    $datatable .= '</legend>';
                     foreach my $option (@{$possoptions->{$field}}) {
                         my $checked;
                         if ($currfield{$field} eq $option) {
@@ -4604,15 +4804,16 @@
                                       'value="'.$option.'"'.$checked.$clickaction.' />'.$fieldoptions->{$option}.
                                       '</label></span>'.(' 'x2);
                     }
+                    $datatable .= '</fieldset>';
                 }
                 if ($field eq 'screenshot') {
                     my $display;
                     if ($currfield{$field} eq 'no') {
-                        $display = ' style="display:none"';
+                        $display = ' style="display: none;"';
                     }
                     $datatable .= '</td></tr><tr id="help_screenshotsize"'.$display.'>'.
-                                  '<td>'.&mt('Maximum size for upload (MB)').'</td><td>'.
-                                  '<input type="text" size="5" name="helpform_maxsize" value="'.$maxsize.'" />';
+                                  '<td><label for="helpform_maxsize">'.&mt('Maximum size for upload (MB)').'</label></td><td>'.
+                                  '<input type="text" size="5" name="helpform_maxsize" id="helpform_maxsize" value="'.$maxsize.'" />';
                 }
                 $datatable .= '</td></tr>';
             }
@@ -4630,6 +4831,9 @@
                           '<td class="LC_left_item">';
             if (($type eq 'helpdeskmail') || ($type eq 'otherdomsmail')) {
                 $datatable .= '<fieldset><legend>'.&mt('E-mail recipient(s)').'</legend>';
+            } else {
+                $datatable .= '<fieldset class="LC_borderless" style="line-height: 170%;">'.
+                              '<legend class="LC_visually_hidden">'.$titles->{$type}.'</legend>';
             }
             $datatable .= '<span class="LC_nobreak">';
             foreach my $item (@contacts) {
@@ -4639,9 +4843,10 @@
                               ' value="'.$item.'" />'.$short_titles->{$item}.
                               '</label> ';
             }
-            $datatable .= '</span><br />'.&mt('Others').':  '.
+            $datatable .= '</span><br /><div style="margin: 4px 0 4px 0; padding: 0;">'.
+                          '<label>'.&mt('Others').':  '.
                           '<input type="text" name="'.$type.'_others" '.
-                          'value="'.$otheremails{$type}.'"  />';
+                          'value="'.$otheremails{$type}.'"  /></label>';
             my %locchecked;
             if (($type eq 'helpdeskmail') || ($type eq 'otherdomsmail')) {
                 foreach my $loc ('s','b') {
@@ -4650,17 +4855,20 @@
                         last;
                     }
                 }
-                $datatable .= '<br />'.&mt('Bcc:').(' 'x6).
-                              '<input type="text" name="'.$type.'_bcc" '.
-                              'value="'.$bccemails{$type}.'"  /></fieldset>'.
+                $datatable .= '</div><div style="margin: 4px 0 4px 0; padding: 0;">'.
+                              '<label for="'.$type.'_bcc">'.&mt('Bcc:').'</label>'.(' 'x6).
+                              '<input type="text" name="'.$type.'_bcc" id="'.$type.'_bcc" '.
+                              'value="'.$bccemails{$type}.'"  /></div></fieldset>'.
                               '<fieldset><legend>'.&mt('Optional added text').'</legend>'.
-                              &mt('Text automatically added to e-mail:').' '.
-                              '<input type="text" name="'.$type.'_includestr" value="'.$includestr{$type}.'" /><br />'.
+                              '<label>'.&mt('Text automatically added to e-mail:').' '.
+                              '<input type="text" name="'.$type.'_includestr" value="'.$includestr{$type}.'" /></label><br /><div style="margin: 4px 0 0 0;">'.
                               '<span class="LC_nobreak">'.&mt('Location:').' '.
                               '<label><input type="radio" name="'.$type.'_includeloc" value="s"'.$locchecked{'s'}.' />'.&mt('in subject').'</label>'.
                               (' 'x2).
                               '<label><input type="radio" name="'.$type.'_includeloc" value="b"'.$locchecked{'b'}.' />'.&mt('in body').'</label>'.
-                              '</span></fieldset>';
+                              '</span></div></fieldset>';
+            } else {
+                $datatable .= '</div></fieldset>';
             }
             $datatable .= '</td></tr>'."\n";
             $rownum ++;
@@ -4715,9 +4923,9 @@
             $css_class = $rownum%2?' class="LC_odd_row"':'';
             $datatable .= '<tr'.$css_class.'>'.
                           '<td class="LC_left_item"><span class="LC_nobreak">'.
-                          $titles->{$item}.
+                          '<label for="'.$item.'">'.$titles->{$item}.'</label>'.
                           '</span></td><td class="LC_left_item">'.
-                          '<input type="text" name="'.$item.'" value="'.
+                          '<input type="text" name="'.$item.'" id="'.$item.'" value="'.
                           $current{$item}.'" size="5" /></td></tr>';
             $rownum ++;
         }
@@ -4725,46 +4933,44 @@
         $datatable .= '<tr'.$css_class.'>'.
                       '<td class="LC_left_item">'.
                       '<span class="LC_nobreak">'.$titles->{'errorweights'}.
-                      '</span></td><td class="LC_left_item"><table><tr>';
+                      '</span></td><td class="LC_left_item">'.
+                      '<div class="LC_grid" role="grid">'.
+                      '<div class="LC_grid_row" role="row">';
         foreach my $type ('E','W','N','U') {
-            $datatable .= '<td>'.$names->{$type}.'<br />'.
-                          '<input type="text" name="errorweights_'.$type.'" value="'.
-                          $weights{$type}.'" size="5" /></td>';
+            $datatable .= '<div class="LC_grid_cell" role="gridcell"><label for="errorweights_'.$type.'">'.$names->{$type}.'</label><br />'.
+                          '<input type="text" name="errorweights_'.$type.'" id="errorweights_'.$type.'" value="'.
+                          $weights{$type}.'" size="5" /></div>';
         }
-        $datatable .= '</tr></table></tr>';
+        $datatable .= '</div></div></td></tr>';
         $rownum ++;
         $css_class = $rownum%2?' class="LC_odd_row"':'';
         $datatable .= '<tr'.$css_class.'><td class="LC_left_item">'.
                       $titles->{'errorexcluded'}.'</td>'.
-                      '<td class="LC_left_item"><table>';
+                      '<td class="LC_left_item">'.
+                      '<fieldset class="LC_borderless">'.
+                      '<legend class="LC_visually_hidden">'.&mt('Exclude?').'</legend>'.
+                      '<div class="LC_grid" role="grid">';
         my $numinrow = 4;
         my @ids = sort(values(%Apache::lonnet::serverhomeIDs));
         for (my $i=0; $i<@ids; $i++) {
             my $rem = $i%($numinrow);
             if ($rem == 0) {
                 if ($i > 0) {
-                    $datatable .= '</tr>';
+                    $datatable .= '</div>';
                 }
-                $datatable .= '<tr>';
+                $datatable .= '<div class="LC_grid_row" role="row">';
             }
             my $check;
             if ($excluded{$ids[$i]}) {
                 $check = ' checked="checked" ';
             }
-            $datatable .= '<td class="LC_left_item">'.
+            $datatable .= '<div class="LC_grid_cell" role="gridcell">'.
                           '<span class="LC_nobreak"><label>'.
                           '<input type="checkbox" name="errorexcluded" '.
                           'value="'.$ids[$i].'"'.$check.' />'.
-                          $ids[$i].'</label></span></td>';
-        }
-        my $colsleft = $numinrow - @ids%($numinrow);
-        if ($colsleft > 1 ) {
-            $datatable .= '<td colspan="'.$colsleft.'" class="LC_left_item">'.
-                          ' </td>';
-        } elsif ($colsleft == 1) {
-            $datatable .= '<td class="LC_left_item"> </td>';
+                          $ids[$i].'</label></span></div>';
         }
-        $datatable .= '</tr></table></td></tr>';
+        $datatable .= '</div></div></fieldset></td></tr>';
         $rownum ++;
     } elsif ($position eq 'bottom') {
         my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);
@@ -4818,9 +5024,9 @@
                 $css_class .= $customclass;
                 my $rowid = $optionsprefix.$status;
                 my $hidden = 1;
-                my $currstyle = 'display:none';
+                my $currstyle = 'display: none;';
                 if (grep(/^\Q$status\E$/, at overridden)) {
-                    $currstyle = 'display:table-row';
+                    $currstyle = 'display: table-row;';
                     $hidden = 0;
                 }
                 my $key = 'override_'.$status;
@@ -4878,8 +5084,9 @@
                        ' value="'.$item.'" />'.$title.'</label> ';
         }
     }
-    $output .= '</span><br />'.&mt('Others').':  '.
-               '<input type="text" name="override_'.$type.'_others" '.
+    $output .= '</span><br /><div style="margin: 4px 0 4px 0; padding: 0;">'.
+               '<label for="override_'.$type.'_others">'.&mt('Others').'</label>:  '.
+               '<input type="text" name="override_'.$type.'_others" id="override_'.$type.'_others" '.
                'value="'.$otheremails.'"  />';
     my %locchecked;
     foreach my $loc ('s','b') {
@@ -4888,17 +5095,18 @@
             last;
         }
     }
-    $output .= '<br />'.&mt('Bcc:').(' 'x6).
-               '<input type="text" name="override_'.$type.'_bcc" '.
-               'value="'.$bccemails.'"  /></fieldset>'.
+    $output .= '</div><div style="margin: 4px 0 4px 0; padding: 0;">'.
+               '<label for="override_'.$type.'_bcc">'.&mt('Bcc:').'</label>'.(' 'x6).
+               '<input type="text" name="override_'.$type.'_bcc" id="override_'.$type.'_bcc" '.
+               'value="'.$bccemails.'"  /></div></fieldset>'.
                '<fieldset><legend>'.&mt('Optional added text').'</legend>'.
-               &mt('Text automatically added to e-mail:').' '.
-               '<input type="text" name="override_'.$type.'_includestr" value="'.$includestr.'" /><br />'.
+               '<label>'.&mt('Text automatically added to e-mail:').' '.
+               '<input type="text" name="override_'.$type.'_includestr" value="'.$includestr.'" /></label><br /><div style="margin: 4px 0 0 0;">'.
                '<span class="LC_nobreak">'.&mt('Location:').' '.
                '<label><input type="radio" name="override_'.$type.'_includeloc" value="s"'.$locchecked{'s'}.' />'.&mt('in subject').'</label>'.
                (' 'x2).
                '<label><input type="radio" name="override_'.$type.'_includeloc" value="b"'.$locchecked{'b'}.' />'.&mt('in body').'</label>'.
-               '</span></fieldset>'.
+               '</span></div></fieldset>'.
                '</td></tr>'."\n";
     return $output;
 }
@@ -5054,8 +5262,10 @@
             my @templateroles = &Apache::lonuserutils::custom_template_roles($context,$crstype);
             $css_class = $itemcount%2?' class="LC_odd_row"':'';
             my $chgstr = ' onchange="javascript:reorderHelpRoles(this.form,'."'helproles_".$num."_pos'".');"';
+            my $arialabel = &mt('Set display order for existing helpdesk role: [_1]',
+                                $desc);
             $datatable .= '<tr '.$css_class.'><td style="vertical-align: top"><b>'.$role.'</b><br />'.
-                          '<select name="helproles_'.$num.'_pos"'.$chgstr.'>';
+                          '<select name="helproles_'.$num.'_pos"'.$chgstr.' aria-label="'.$arialabel.'">';
             for (my $k=0; $k<=$maxnum; $k++) {
                 my $vpos = $k+1;
                 my $selstr;
@@ -5068,17 +5278,17 @@
                           '<input type="hidden" name="helproles_'.$num.'" value="'.$role.'" />'.
                           '</td>'.
                           '<td><fieldset><legend>'.&mt('Role name').'</legend>'.
-                          &mt('Name shown to users:').
+                          '<label>'.&mt('Name shown to users:').
                           '<input type="text" name="helproles_'.$num.'_desc" value="'.$desc.'" />'.
-                          '</fieldset>'.
-                          &helpdeskroles_access($dom,$prefix,$num,$add_class,$current{$role},\@accesstypes,
+                          '</label></fieldset>'.
+                          &helpdeskroles_access($dom,$desc,$prefix,$num,$add_class,$current{$role},\@accesstypes,
                                                 $othertitle,$usertypes,$types,\%domhelpdesk).
                           '<fieldset>'.
                           '<legend>'.&mt('Role privileges').&adhocbutton($prefix,$num,'privs','show').'</legend>'.
                           &Apache::lonuserutils::custom_role_table($crstype,\%full,\%levels,
                                                                    \%levelscurrent,$identifier,
                                                                    'LC_hidden',$prefix.$num.'_privs').
-                          '</fieldset></td>';
+                          '</fieldset></td></tr>';
             $itemcount ++;
         }
         $css_class = $itemcount%2?' class="LC_odd_row"':'';
@@ -5093,9 +5303,10 @@
         &Apache::lonuserutils::custom_role_privs(\%privs,\%full,\%levels,\%levelscurrent);
         my @templateroles = &Apache::lonuserutils::custom_template_roles($context,$crstype);
         my $chgstr = ' onchange="javascript:reorderHelpRoles(this.form,'."'helproles_".$count."_pos'".');"';
-        $datatable .= '<tr '.$css_class.'><td style="vertical-align: top"><span class="LC_nobreak"><label>'.
+        my $arialabel = &mt('Set display order for new helpdesk role');
+        $datatable .= '<tr '.$css_class.'><td style="vertical-align: top"><span class="LC_nobreak">'.
                       '<input type="hidden" name="helproles_maxnum" value="'.$maxnum.'" />'."\n".
-                      '<select name="helproles_'.$count.'_pos"'.$chgstr.'>';
+                      '<select name="helproles_'.$count.'_pos"'.$chgstr.' aria-label="'.$arialabel.'">';
         for (my $k=0; $k<$maxnum+1; $k++) {
             my $vpos = $k+1;
             my $selstr;
@@ -5104,19 +5315,20 @@
             }
             $datatable .= '<option value="'.$k.'"'.$selstr.'>'.$vpos.'</option>';
         }
+        my $labeltext = &mt('Add a new helpdesk role');
         $datatable .= '</select> '."\n".
-                      '<input type="checkbox" name="newcusthelp" value="'.$count.'" />'. &mt('Add').
-                      '</label></span></td>'.
+                      '<input type="checkbox" name="newcusthelp" value="'.$count.'" aria-label="'.$labeltext.'" />'.
+		      &mt('Add').'</span></td>'.
                       '<td><fieldset><legend>'.&mt('Role name').'</legend>'.
                       '<span class="LC_nobreak">'.
-                      &mt('Internal name:').
+                      '<label>'.&mt('Internal name:').
                       '<input type="text" size="10" name="custhelpname'.$count.'" value="" />'.
-                      '</span>'.(' 'x4).
+                      '</label></span>'.(' 'x4).
                       '<span class="LC_nobreak">'.
-                      &mt('Name shown to users:').
+                      '<label>'.&mt('Name shown to users:').
                       '<input type="text" size="20" name="helproles_'.$count.'_desc" value="" />'.
-                      '</span></fieldset>'.
-                       &helpdeskroles_access($dom,$prefix,$count,'',undef,\@accesstypes,$othertitle,
+                      '</label></span></fieldset>'.
+                       &helpdeskroles_access($dom,'',$prefix,$count,'',undef,\@accesstypes,$othertitle,
                                              $usertypes,$types,\%domhelpdesk).
                       '<fieldset><legend>'.&mt('Role privileges').'</legend>'.
                       &Apache::lonuserutils::custom_role_header($context,$crstype,
@@ -5276,7 +5488,7 @@
 }
 
 sub helpdeskroles_access {
-    my ($dom,$prefix,$num,$add_class,$current,$accesstypes,$othertitle,
+    my ($dom,$name,$prefix,$num,$add_class,$current,$accesstypes,$othertitle,
         $usertypes,$types,$domhelpdesk) = @_;
     return unless ((ref($accesstypes) eq 'ARRAY') && (ref($domhelpdesk) eq 'HASH'));
     my %lt = &Apache::lonlocal::texthash(
@@ -5314,27 +5526,27 @@
             }
         }
     }
-    $output = '<fieldset id="'.$prefix.$num.'_usage"><legend>'.$lt{'rou'}.'</legend>'.
+    $output = '<fieldset id="'.$prefix.$num.'_usage">'.
+              '<legend>'.$lt{'rou'}.'</legend>'.
               '<p>'.$lt{'whi'}.'</p>';
     foreach my $access (@{$accesstypes}) {
-        $output .= '<p><label><input type="radio" name="'.$prefix.$num.'_access" value="'.$access.'" '.$usecheck{$access}.
+	$output .= '<p><label><input type="radio" name="'.$prefix.$num.'_access" value="'.$access.'" '.$usecheck{$access}.
                    ' onclick="helpdeskAccess('."'$num'".');" />'.
-                   $lt{$access}.'</label>';
+                   $lt{$access}.'</label></p>';
         if ($access eq 'status') {
             $output .= '<div id="'.$prefix.$num.'_bystatus" style="display:'.$displaydiv{$access}.'">'.
-                       &Apache::lonuserutils::adhoc_status_types($dom,$prefix,$num,$current->{$access},
+                       &Apache::lonuserutils::adhoc_status_types($dom,$name,$prefix,$num,$current->{$access},
                                                                  $othertitle,$usertypes,$types).
                        '</div>';
         } elsif (($access eq 'inc') && (keys(%{$domhelpdesk}) > 0)) {
             $output .= '<div id="'.$prefix.$num.'_notinc" style="display:'.$displaydiv{$access}.'">'.
-                       &Apache::lonuserutils::adhoc_staff($access,$prefix,$num,$current->{$access},$domhelpdesk).
+                       &Apache::lonuserutils::adhoc_staff($access,$name,$prefix,$num,$current->{$access},$domhelpdesk).
                        '</div>';
         } elsif (($access eq 'exc') && (keys(%{$domhelpdesk}) > 0)) {
             $output .= '<div id="'.$prefix.$num.'_notexc" style="display:'.$displaydiv{$access}.'">'.
-                       &Apache::lonuserutils::adhoc_staff($access,$prefix,$num,$current->{$access},$domhelpdesk).
+                       &Apache::lonuserutils::adhoc_staff($access,$name,$prefix,$num,$current->{$access},$domhelpdesk).
                        '</div>';
         }
-        $output .= '</p>';
     }
     $output .= '</fieldset>';
     return $output;
@@ -5342,7 +5554,7 @@
 
 sub radiobutton_prefs {
     my ($settings,$toggles,$defaultchecked,$choices,$itemcount,$onclick,
-        $additional,$align,$firstval) = @_;
+        $additional,$align,$firstval,$lineheight) = @_;
     return unless ((ref($toggles) eq 'ARRAY') && (ref($defaultchecked) eq 'HASH') &&
                    (ref($choices) eq 'HASH'));
 
@@ -5371,10 +5583,13 @@
     if ($onclick) {
         $onclick = ' onclick="'.$onclick.'"';
     }
+    if ($lineheight =~ /^\d+$/) {
+        $lineheight = ' style="line-height: '.$lineheight.'%;"'; 
+    }
     foreach my $item (@{$toggles}) {
         $css_class = $itemcount%2?' class="LC_odd_row"':'';
         $datatable .=
-            '<tr'.$css_class.'><td style="vertical-align: top">'.
+            '<tr'.$css_class.'><td style="vertical-align: top; line-height: 170%;">'.
             '<span class="LC_nobreak">'.$choices->{$item}.
             '</span></td>';
         if ($align eq 'left') {
@@ -5382,7 +5597,9 @@
         } else {
             $datatable .= '<td class="LC_right_item">';
         }
-        $datatable .= '<span class="LC_nobreak">';
+        $datatable .= '<fieldset class="LC_borderless"'.$lineheight.'>'.
+                      '<legend class="LC_visually_hidden">'.$choices->{$item}.'</legend>'.
+                      '<span class="LC_nobreak">';
         if ($firstval eq 'no') {
             $datatable .=
                 '<label><input type="radio" name="'.
@@ -5396,7 +5613,7 @@
                 '</label> <label><input type="radio" name="'.$item.'" '.
                 $checkedoff{$item}.' value="0"'.$onclick.' />'.&mt('No').'</label>';
         }
-        $datatable .= '</span>'.$additional.'</td></tr>';
+        $datatable .= '</span></fieldset>'.$additional.'</td></tr>';
         $itemcount ++;
     }
     return ($datatable,$itemcount);
@@ -5477,9 +5694,9 @@
             }
             if ($showextra) {
                 $numshown ++;
-                $divsty = 'display:inline-block';
+                $divsty = 'display: inline-block;';
             } else {
-                $divsty = 'display:none';
+                $divsty = 'display: none;';
             }
             $extra .= '<fieldset id="'.$context.'_info_'.$hostid.'" style="'.$divsty.'">'.
                       '<legend>'.$hostid.'</legend>';
@@ -5488,14 +5705,14 @@
                                    &HTML::Entities::encode($env{'request.role'},'\'<>"&').
                                    '&destinationurl=/adm/domainprefs">'.&mt('Switch Server').'</a>';
                 if (exists($privkeys->{$hostid})) {
-                    $extra .= '<div id="'.$context.'_divcurrprivkey_'.$hostid.'" style="display:inline-block" />'.
+                    $extra .= '<div id="'.$context.'_divcurrprivkey_'.$hostid.'" style="display: inline-block;">'.
                               '<span class="LC_nobreak">'.
-                              &mt('Encryption Key').': ['.&mt('not shown').'] '.(' 'x2).'</span></div>'.
+                              &mt('Encryption Key').': ['.&mt('not shown').'] '.(' 'x2).'</span>'.
                               '<span class="LC_nobreak">'.&mt('Change?').
                               '<label><input type="radio" value="0" name="'.$context.'_changeprivkey_'.$hostid.'" onclick="javascript:togglePrivKey(this.form,'."'$context','$hostid'".');" checked="checked" />'.&mt('No').'</label>'.
                               (' 'x2).
                               '<label><input type="radio" value="1" name="'.$context.'_changeprivkey_'.$hostid.'" onclick="javascript:togglePrivKey(this.form,'."'$context','$hostid'".');" />'.&mt('Yes').
-                              '</label>  </span><div id="'.$context.'_divchgprivkey_'.$hostid.'" style="display:none" />'.
+                              '</label>  </span></div><div id="'.$context.'_divchgprivkey_'.$hostid.'" style="display: none;">'.
                               '<span class="LC_nobreak"> - '.&mt('submit from server ([_1]): [_2].',$hostid,$switchserver).
                               '</span></div>';
                 } else {
@@ -5504,21 +5721,21 @@
                               '</span>'."\n";
                 }
             } elsif (exists($privkeys->{$hostid})) {
-                $extra .= '<div id="'.$context.'_divcurrprivkey_'.$hostid.'" style="display:inline-block" /><span class="LC_nobreak">'.
+                $extra .= '<div id="'.$context.'_divcurrprivkey_'.$hostid.'" style="display: inline-block;"><span class="LC_nobreak">'.
                           &mt('Encryption Key').': ['.&mt('not shown').'] '.(' 'x2).'</span></div>'.
                           '<span class="LC_nobreak">'.&mt('Change?').
                           '<label><input type="radio" value="0" name="'.$context.'_changeprivkey_'.$hostid.'" onclick="javascript:togglePrivKey(this.form,'."'$context','$hostid'".');" checked="checked" />'.&mt('No').'</label>'.
                           (' 'x2).
                           '<label><input type="radio" value="1" name="'.$context.'_changeprivkey_'.$hostid.'" onclick="javascript:togglePrivKey(this.form,'."'$context','$hostid'".');" />'.&mt('Yes').
-                          '</label>  </span><div id="'.$context.'_divchgprivkey_'.$hostid.'" style="display:none" />'.
-                          '<span class="LC_nobreak">'.&mt('New Key').':'.
-                          '<input type="password" size="20" name="'.$context.'_privkey_'.$hostid.'" value="" autocomplete="new-password" />'.
-                          '<label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.'.$context.'_privkey_'.$hostid.'.type='."'text'".' } else { this.form.'.$context.'_privkey_'.$hostid.'.type='."'password'".' }" />'.&mt('Visible input').'</label>'.
+                          '</label>  </span><div id="'.$context.'_divchgprivkey_'.$hostid.'" style="display: none;">'.
+                          '<span class="LC_nobreak"><label>'.&mt('New Key').':'.
+                          '<input type="password" size="20" name="'.$context.'_privkey_'.$hostid.'" value="" autocomplete="new-password" /></label>'.
+                          ' <label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.'.$context.'_privkey_'.$hostid.'.type='."'text'".' } else { this.form.'.$context.'_privkey_'.$hostid.'.type='."'password'".' }" />'.&mt('Visible input').'</label>'.
                           '</span></div>';
             } else {
-                $extra .= '<span class="LC_nobreak">'.&mt('Encryption Key').':'.
-                          '<input type="password" size="20" name="'.$context.'_privkey_'.$hostid.'" value="" autocomplete="new-password" />'.
-                          '<label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.'.$context.'_privkey_'.$hostid.'.type='."'text'".' } else { this.form.'.$context.'_privkey_'.$hostid.'.type='."'password'".' }" />'.&mt('Visible input').'</label>';
+                $extra .= '<span class="LC_nobreak"><label>'.&mt('Encryption Key').':'.
+                          '<input type="password" size="20" name="'.$context.'_privkey_'.$hostid.'" value="" autocomplete="new-password" /></label>'.
+                          ' <label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.'.$context.'_privkey_'.$hostid.'.type='."'text'".' } else { this.form.'.$context.'_privkey_'.$hostid.'.type='."'password'".' }" />'.&mt('Visible input').'</label></span>';
             }
             $extra .= '</fieldset>';
         }
@@ -5553,12 +5770,12 @@
                                               \%choices,$itemcount,$onclick,'','left','no');
 
     $css_class = $itemcount%2?' class="LC_odd_row"':'';
-    my $noprivkeysty = 'display:inline-block';
+    my $noprivkeysty = 'display: inline-block;';
     if ($numshown) {
-        $noprivkeysty = 'display:none';
+        $noprivkeysty = 'display: none;';
     }
-    $output .= '<tr '.$css_class.'><td><span class="LC_nobreak">'.&mt('Encryption Key(s)').'</td>'.
-               '<td><div id="'.$context.'_noprivkey" style="'.$noprivkeysty.'" >'.
+    $output .= '<tr '.$css_class.'><td><span class="LC_nobreak">'.&mt('Encryption Key(s)').'</span></td>'.
+               '<td><div id="'.$context.'_noprivkey" style="'.$noprivkeysty.'">'.
                '<span class="LC_nobreak">'.&mt('Not in use').'</span></div>'.
                $extra.
                '</td></tr>';
@@ -5710,8 +5927,9 @@
                 $checkedavailable{'no'} = '';
             }
             my $chgstr = ' onchange="javascript:reorderProctoring(this.form,'."'proctoring_pos_".$provider."'".');"';
+            my $arialabel = &mt('Set list order for [_1]',$providernames{$provider});
             $datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">'
-                         .'<select name="proctoring_pos_'.$provider.'"'.$chgstr.'>';
+                         .'<select name="proctoring_pos_'.$provider.'"'.$chgstr.' aria-label="'.$arialabel.'">';
             for (my $k=0; $k<$maxnum; $k++) {
                 my $vpos = $k+1;
                 my $selstr;
@@ -5732,27 +5950,30 @@
             }
             $datatable .=
                 '</select>'.(' 'x2).'<b>'.$providernames{$provider}.'</b></span><br />'.
-                '<span class="LC_nobreak">'.$lt{'avai'}.' '.
+                '<fieldset class="LC_borderless">'.
+                '<legend class="LC_visually_hidden">'.$lt{'avai'}.'</legend>'.
+                '<span class="LC_nobreak"><span aria-hidden="true">'.$lt{'avai'}.' </span>'.
                 '<label><input type="radio" name="proctoring_available_'.$provider.'" value="1"'.$onclickavailable.$checkedavailable{yes}.' />'.&mt('Yes').'</label> '."\n".
-                '<label><input type="radio" name="proctoring_available_'.$provider.'" value="0"'.$onclickavailable.$checkedavailable{no}.' />'.&mt('No').'</label></span>'."\n".
+                '<label><input type="radio" name="proctoring_available_'.$provider.'" value="0"'.$onclickavailable.$checkedavailable{no}.' />'.&mt('No').'</label></span></fieldset>'."\n".
                 '</td>'.
                 '<td colspan="2">'.
-                '<fieldset class="proctoring_'.$provider.'" style="display:'.$optionsty.'"><legend>'.$lt{'base'}.'</legend>'.
-                '<span class="LC_nobreak">'.$lt{'version'}.':<select name="proctoring_'.$provider.'_version">'.
+                '<fieldset class="proctoring_'.$provider.'" style="display:'.$optionsty.'; line-height: 180%;">'.
+                '<legend>'.$lt{'base'}.'</legend>'.
+                '<span class="LC_nobreak"><label for="proctoring_'.$provider.'_version">'.$lt{'version'}.'</label>:<select name="proctoring_'.$provider.'_version" id="proctoring_'.$provider.'_version">'.
                 '<option value="'.$version.'" selected="selected">'.$version.'</option></select></span> '."\n".
                 (' 'x2).
-                '<span class="LC_nobreak">'.$lt{'sigmethod'}.':<select name="proctoring_'.$provider.'_sigmethod">'.
+                '<span class="LC_nobreak"><label>'.$lt{'sigmethod'}.':<select name="proctoring_'.$provider.'_sigmethod">'.
                 '<option value="HMAC-SHA1" selected="selected">HMAC-SHA1</option>'.
-                '<option value="HMAC-SHA256">HMAC-SHA256</option></select></span>'.
+                '<option value="HMAC-SHA256">HMAC-SHA256</option></select></label></span>'.
                 (' 'x2).
-                '<span class="LC_nobreak">'.$lt{'lifetime'}.':<input type="text" size="5" name="proctoring_'.$provider.'_lifetime" value="'.$lifetime.'" /></span> '."\n".
+                '<span class="LC_nobreak"><label>'.$lt{'lifetime'}.':<input type="text" size="5" name="proctoring_'.$provider.'_lifetime" value="'.$lifetime.'" /></label></span> '."\n".
                 '<br />'.
-                '<span class="LC_nobreak">'.$lt{'url'}.':<input type="text" size="40" name="proctoring_'.$provider.'_url" value="'.$current{'url'}.'" /></span> '."\n".
+                '<span class="LC_nobreak"><label>'.$lt{'url'}.':<input type="text" size="40" name="proctoring_'.$provider.'_url" value="'.$current{'url'}.'" /></label></span> '."\n".
                 '<br />'.
-                '<span class="LC_nobreak">'.$lt{'key'}.':<input type="text" size="25" name="proctoring_'.$provider.'_key" value="'.$current{'key'}.'" /></span> '."\n".
+                '<span class="LC_nobreak"><label>'.$lt{'key'}.':<input type="text" size="25" name="proctoring_'.$provider.'_key" value="'.$current{'key'}.'" /></label></span> '."\n".
                 (' 'x2).
-                '<span class="LC_nobreak">'.$lt{'secret'}.':<input type="password" size="20" name="proctoring_'.$provider.'_secret" value="'.$current{'secret'}.'" />'.
-                '<label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.proctoring_'.$provider.'_secret.type='."'text'".' } else { this.form.proctoring_'.$provider.'_secret.type='."'password'".' }" />'.$lt{'visible'}.'</label></span><br />'."\n";
+                '<span class="LC_nobreak"><label>'.$lt{'secret'}.':<input type="password" size="20" name="proctoring_'.$provider.'_secret" value="'.$current{'secret'}.'" /></label>'.
+                ' <label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.proctoring_'.$provider.'_secret.type='."'text'".' } else { this.form.proctoring_'.$provider.'_secret.type='."'password'".' }" />'.$lt{'visible'}.'</label></span><br />'."\n";
             $datatable .= '<span class="LC_nobreak">'.$lt{'icon'}.': ';
             if ($imgsrc) {
                 $datatable .= $imgsrc.
@@ -5764,8 +5985,10 @@
             if ($switchserver) {
                 $datatable .= &mt('Upload to library server: [_1]',$switchserver);
             } else {
-                $datatable .= '<input type="file" name="proctoring_image_'.$provider.'" value="" />';
+                my $labeltext = &mt('Choose icon file to upload');
+                $datatable .= '<input type="file" name="proctoring_image_'.$provider.'" value="" aria-label="'.$labeltext.'" />';
             }
+            $datatable .= '</span>';
             unless ($imgsrc) {
                 $datatable .= '<br />('.&mt('if larger than 21x21 pixels, image will be scaled').')';
             }
@@ -5785,7 +6008,7 @@
                                 $unseluserdom = '';
                             }
                             $datatable .= ': '.
-                                '<select name="proctoring_userincdom_'.$provider.'">'.
+                                '<select name="proctoring_userincdom_'.$provider.'" aria-label="'.&mt('Format for user ID in LTI payload').'">'.
                                 '<option value="0"'.$unseluserdom.'>'.$lt{'username'}.'</option>'.
                                 '<option value="1"'.$seluserdom.'>'.$lt{'uname:dom'}.'</option>'.
                                 '</select> ';
@@ -5823,7 +6046,7 @@
                     $datatable .= '<fieldset class="proctoring_'.$provider.'" style="display:'.$optionsty.'"><legend>'.$lt{'defa'}.'</legend>';
                     my ($rem,$numinrow,$dropdowns);
                     if ($provider eq 'proctorio') { 
-                        $datatable .= '<table>';
+                        $datatable .= '<div class="LC_grid" role="grid" style="margin: 0;">';
                         $numinrow = 4;
                     }
                     my $i = 0;
@@ -5851,13 +6074,17 @@
                                                   (' 'x2);
                                 }
                                 $datatable .= '</span><br />'.
-                                              '<div class="LC_left_float">'.$fieldtitles{'linktext'}.'<br />'.
+                                              '<div class="LC_left_float"><label for="proctoring_linktext_'.$provider.'">'.
+                                              $fieldtitles{'linktext'}.'</label><br />'.
                                               '<input type="text" name="proctoring_linktext_'.$provider.'" '.
+                                              'id="proctoring_linktext_'.$provider.'" '.
                                               'size="25" value="'.$currentdef{'linktext'}.'" /></div>'.
-                                              '<div class="LC_left_float">'.$fieldtitles{'explanation'}.'<br />'.
-                                              '<textarea name="proctoring_explanation_'.$provider.'" rows="5" cols="40">'.
+                                              '<div class="LC_left_float"><label for="proctoring_explanation_'.$provider.'">'.
+                                              $fieldtitles{'explanation'}.'</label><br />'.
+                                              '<textarea name="proctoring_explanation_'.$provider.'" '.
+                                              'id="proctoring_explanation_'.$provider.'" rows="5" cols="40">'.
                                               $currentdef{'explanation'}.
-                                              '</textarea></div><div style=""></div><br />';
+                                              '</textarea></div><div style="padding:0;clear:both;margin:0;border:0"></div><br />';
                             }
                         } else {
                             if ((exists($options{$field})) && (ref($options{$field}) eq 'ARRAY')) {
@@ -5865,7 +6092,7 @@
                                 unless ($checked) {
                                     $selnone = ' selected="selected"';
                                 }
-                                $output .= '<span class="LC_nobreak">'.$fieldtitles{$field}.': '.
+                                $output .= '<span class="LC_nobreak"><label>'.$fieldtitles{$field}.': '.
                                            '<select name="proctoring_defaults_'.$field.'_'.$provider.'">'.
                                            '<option value=""'.$selnone.'>'.&mt('Not in use').'</option>'; 
                                 foreach my $option (@{$options{$field}}) {
@@ -5875,61 +6102,41 @@
                                     }
                                     $output .= '<option value="'.$option.'"'.$sel.'>'.$fieldtitles{$option}.'</option>';
                                 }
-                                $output .= '</select></span>';
+                                $output .= '</select></label></span>';
                                 push(@selectboxes,$output);
                             } else {
                                 $rem = $i%($numinrow);
                                 if ($rem == 0) {
                                     if ($i > 0) {
-                                        $datatable .= '</tr>';
+                                        $datatable .= '</div>';
                                     }
-                                    $datatable .= '<tr>';
+                                    $datatable .= '<div class="LC_grid_row" role="row">';
                                 }
-                                $datatable .= '<td class="LC_left_item">'.
+                                $datatable .= '<div class="LC_grid_cell" role="gridcell">'.
                                               '<span class="LC_nobreak">'.
                                               '<label><input type="checkbox" name="proctoring_defaults_'.$provider.'" value="'.$field.'"'.$checked.' />'.
-                                              $fieldtitles{$field}.'</label></span></td>';
+                                              $fieldtitles{$field}.'</label></span></div>';
                                 $i++;
                             }
                         }
                     }
                     if ($provider eq 'proctorio') {
-                        if ($numinrow) {
-                            $rem = $i%$numinrow;
-                        }
-                        my $colsleft = $numinrow - $rem;
-                        if ($colsleft > 1) {
-                            $datatable .= '<td colspan="'.$colsleft.'" class="LC_left_item">';
-                        } else {
-                            $datatable .= '<td class="LC_left_item">';
-                        }
-                        $datatable .= ' '.
-                                      '</td></tr></table>';
+                        $datatable .= '</div></div>';
                         if (@selectboxes) {
-                            $datatable .= '<hr /><table>';
+                            $datatable .= '<hr /><div class="LC_grid" role="grid">';
                             $numinrow = 2;
                             for (my $i=0; $i<@selectboxes; $i++) {
                                 $rem = $i%($numinrow);
                                 if ($rem == 0) {
                                     if ($i > 0) {
-                                        $datatable .= '</tr>';
+                                        $datatable .= '</div>';
                                     }
-                                    $datatable .= '<tr>';
+                                    $datatable .= '<div class="LC_grid_row" role="row">';
                                 }
-                                $datatable .= '<td class="LC_left_item">'.
-                                              $selectboxes[$i].'</td>';
+                                $datatable .= '<div class="LC_grid_cell" role="gridcell">'.
+                                              $selectboxes[$i].'</div>';
                             }
-                            if ($numinrow) {
-                                $rem = $i%$numinrow;
-                            }
-                            $colsleft = $numinrow - $rem;
-                            if ($colsleft > 1) {
-                                $datatable .= '<td colspan="'.$colsleft.'" class="LC_left_item">';
-                            } else {
-                                $datatable .= '<td class="LC_left_item">';
-                            }
-                            $datatable .= ' '.
-                                          '</td></tr></table>';
+                            $datatable .= '</div></div>';
                         }
                     }
                     $datatable .= '</fieldset>';
@@ -5939,7 +6146,7 @@
                                   '<legend>'.&mt('Configurable in course').'</legend>';
                     my ($rem,$numinrow);
                     if ($provider eq 'proctorio') {
-                        $datatable .= '<table>';
+                        $datatable .= '<div class="LC_grid" role="grid" style="margin: 0;">';
                         $numinrow = 4;
                     }
                     my $i = 0;
@@ -5952,11 +6159,11 @@
                             $rem = $i%($numinrow);
                             if ($rem == 0) {
                                 if ($i > 0) {
-                                    $datatable .= '</tr>';
+                                    $datatable .= '</div>';
                                 }
-                                $datatable .= '<tr>';
+                                $datatable .= '<div class="LC_grid_row" role="row">';
                             }
-                            $datatable .= '<td class="LC_left_item>';
+                            $datatable .= '<div class="LC_grid_cell" role="gridcell">';
                         }
                         my $checked;
                         if ($crsconfig{$item}) {
@@ -5967,36 +6174,31 @@
                                       $name.'</label></span>';
                         if ($provider eq 'examity') {
                             $datatable .= '  ';
+                        } else {
+                            $datatable .= '</div>';
                         }
                         $datatable .= "\n";
                         $i++;
                     }
                     if ($provider eq 'proctorio') {
-                        if ($numinrow) {
-                            $rem = $i%$numinrow;
-                        }
-                        my $colsleft = $numinrow - $rem;
-                        if ($colsleft > 1) {
-                            $datatable .= '<td colspan="'.$colsleft.'" class="LC_left_item">';
-                        } else {
-                            $datatable .= '<td class="LC_left_item">';
-                        }
-                        $datatable .= ' '.
-                                      '</td></tr></table>';
+                        $datatable .= '</div></div>';
                     }
                     $datatable .= '</fieldset>';
                 }
                 if ($showroles) {
                     $datatable .= '<fieldset class="proctoring_'.$provider.'" style="display:'.$optionsty.'">'.
-                                  '<legend>'.&mt('Role mapping').'</legend><table><tr>';
+                                  '<legend>'.&mt('Role mapping').'</legend>'.
+                                  '<div class="LC_grid" role="grid" style="margin: 0">'.
+                                  '<div class="LC_grid_row" role="row">';
                     foreach my $role (@courseroles) {
                         my ($selected,$selectnone);
                         if (!$rolemaps{$role}) {
                             $selectnone = ' selected="selected"';
                         }
-                        $datatable .= '<td style="text-align: center">'.
-                                      &Apache::lonnet::plaintext($role,'Course').'<br />'.
-                                      '<select name="proctoring_roles_'.$role.'_'.$provider.'">'.
+                        $datatable .= '<div class="LC_grid_cell" role="gridcell" style="text-align: center">'.
+                                      '<label for="proctoring_roles_'.$role.'_'.$provider.'">'.
+                                      &Apache::lonnet::plaintext($role,'Course').'</label><br />'.
+                                      '<select name="proctoring_roles_'.$role.'_'.$provider.'" id="proctoring_roles_'.$role.'_'.$provider.'">'.
                                       '<option value=""'.$selectnone.'>'.&mt('Select').'</option>';
                         foreach my $ltirole (@ltiroles) {
                             unless ($selectnone) {
@@ -6008,34 +6210,41 @@
                             }
                             $datatable .= '<option value="'.$ltirole.'"'.$selected.'>'.$ltirole.'</option>';
                         }
-                        $datatable .= '</select></td>';
+                        $datatable .= '</select></div>';
                     }
-                    $datatable .= '</tr></table></fieldset>'.
+                    $datatable .= '</div></div></fieldset>'.
                                   '<fieldset class="proctoring_'.$provider.'" style="display:'.$optionsty.'">'.
                                   '<legend>'.&mt('Custom items sent on launch').'</legend>'.
                                   '<table><tr><th>'.&mt('Action').'</th><th>'.&mt('Name').'</th><th>'.&mt('Value').'</th></tr>'.
-                                  '<tr><td></td><td>lms</td>'.
+                                  '<tr><td></td><td><label for="proctoring_customval_lms_'.$provider.'">lms</label></td>'.
                                   '<td><input type="text" name="proctoring_customval_lms_'.$provider.'"'.
-                                  ' value="Loncapa" disabled="disabled"/></td></tr>';
+                                  ' id="proctoring_customval_lms_'.$provider.'" value="Loncapa" disabled="disabled" />'.
+                                  '</td></tr>';
                     if ((ref($settings) eq 'HASH') && (ref($settings->{$provider}) eq 'HASH') &&
                         (ref($settings->{$provider}->{'custom'}) eq 'HASH')) {
                         my %custom = %{$settings->{$provider}->{'custom'}};
                         if (keys(%custom) > 0) {
                             foreach my $key (sort(keys(%custom))) {
                                 next if ($key eq 'lms');
+                                my $labeltext = &mt('Value of custom item [_1] in launch payload for [_2]',
+                                                    $key,$providernames{$provider});  
                                 $datatable .= '<tr><td><span class="LC_nobreak">'.
                                               '<label><input type="checkbox" name="proctoring_customdel_'.$provider.'" value="'.
                                               $key.'" />'.&mt('Delete').'</label></span></td><td>'.$key.'</td>'.
                                               '<td><input type="text" name="proctoring_customval_'.$key.'_'.$provider.'"'.
-                                              ' value="'.$custom{$key}.'" /></td></tr>';
+                                              ' value="'.$custom{$key}.'" aria-label="'.$labeltext.'" /></td></tr>';
                             }
                         }
                     }
+                    my $newkey = &mt('Set name of custom key=value pair to include in LTI payload for [_1]',
+                                     $providernames{$provider});
+                    my $newvalue = &mt('Set value of custom key=value pair to include in LTI payload for [_1]',
+                                       $providernames{$provider});
                     $datatable .= '<tr><td><span class="LC_nobreak">'.
                                   '<label><input type="checkbox" name="proctoring_customadd" value="'.$provider.'" />'.
-                                  &mt('Add more').'</label></span></td><td><input type="text" name="proctoring_custom_name_'.$provider.'" />'.
-                                  '</td><td><input type="text" name="proctoring_custom_value_'.$provider.'" /></td></tr>'.
-                                  '</table></fieldset></td></tr>'."\n";
+                                  &mt('Add more').'</label></span></td><td><input type="text" name="proctoring_custom_name_'.$provider.'" aria-label="'.$newkey.'" />'.
+                                  '</td><td><input type="text" name="proctoring_custom_value_'.$provider.'" aria-label="'.$newvalue.'" /></td></tr>'.
+                                  '</table></fieldset>'."\n";
                 }
                 $datatable .= '</td></tr>';
             }
@@ -6275,6 +6484,7 @@
         my %ordered;
         if (ref($settings) eq 'HASH') {
             foreach my $item (keys(%{$settings})) {
+                print STDERR "item is ||$item|| ref is ||".ref($settings->{$item})."||\n";
                 if (ref($settings->{$item}) eq 'HASH') {
                     my $num = $settings->{$item}{'order'};
                     if ($num eq '') {
@@ -6320,8 +6530,9 @@
                     $checkedcrsinc{'yes'} = '';
                 }
                 my $chgstr = ' onchange="javascript:reorderLTI(this.form,'."'lti_pos_".$item."'".');"';
+                my $poslabel = &mt('Set list order for [_1]',$consumer);
                 $datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">'
-                             .'<select name="lti_pos_'.$item.'"'.$chgstr.'>';
+                             .'<select name="lti_pos_'.$item.'"'.$chgstr.' aria-label="'.$poslabel.'">';
                 for (my $k=0; $k<=$maxnum; $k++) {
                     my $vpos = $k+1;
                     my $selstr;
@@ -6335,36 +6546,38 @@
                     &mt('Delete?').'</label></span></td>'.
                     '<td colspan="2">'.
                     '<fieldset><legend>'.&mt('Required settings').'</legend>'.
-                    '<span class="LC_nobreak">'.$lt{'consumer'}.
-                    ':<input type="text" size="15" name="lti_consumer_'.$i.'" value="'.$consumer.'" /></span> '.
+                    '<span class="LC_nobreak"><label>'.$lt{'consumer'}.
+                    ':<input type="text" size="15" name="lti_consumer_'.$i.'" value="'.$consumer.'" /></label></span> '.
                     (' 'x2).
-                    '<span class="LC_nobreak">'.$lt{'version'}.':<select name="lti_version_'.$i.'">'.
+                    '<span class="LC_nobreak"><label for="lti_version_'.$i.'">'.
+                    $lt{'version'}.'</label>:<select name="lti_version_'.$i.'" id="lti_version_'.$i.'">'.
                     '<option value="LTI-1p0" selected="selected">1.1</option></select></span> '.
                     (' 'x2).
-                    '<span class="LC_nobreak">'.$lt{'lifetime'}.':<input type="text" name="lti_lifetime_'.$i.'"'.
-                    'value="'.$lifetime.'" size="3" /></span><br /><br />';
+                    '<span class="LC_nobreak"><label>'.$lt{'lifetime'}.':<input type="text" name="lti_lifetime_'.$i.'" '.
+                    'value="'.$lifetime.'" size="3" /></label></span><br /><br />';
                 if ($key ne '') {
-                    $datatable .= '<span class="LC_nobreak">'.$lt{'key'};
+                    $datatable .= '<span class="LC_nobreak">';
                     if ($switchserver) {
-                        $datatable .= ': ['.&mt('[_1] to view/edit',$switchserver).']';
+                        $datatable .= $lt{'key'}.': ['.&mt('[_1] to view/edit',$switchserver).']';
                     } else {
-                        $datatable .= ':<input type="text" size="25" name="lti_key_'.$i.'" value="'.$key.'" autocomplete="off" />';
+                        $datatable .= '<label>'.$lt{'key'}.
+                                      ':<input type="text" size="25" name="lti_key_'.$i.'" value="'.$key.'" autocomplete="off" />';
                     }
                     $datatable .= '</span> '.(' 'x2);
                 } elsif (!$switchserver) {
-                    $datatable .= '<span class="LC_nobreak">'.$lt{'key'}.':'.
-                                  '<input type="text" size="25" name="lti_key_'.$i.'" value="'.$key.'" autocomplete="off" />'.
+                    $datatable .= '<span class="LC_nobreak"><label>'.$lt{'key'}.':'.
+                                  '<input type="text" size="25" name="lti_key_'.$i.'" value="'.$key.'" autocomplete="off" /></label>'.
                                   '</span> '.(' 'x2);
                 }
                 if ($switchserver) {
                     if ($usable ne '') {
-                        $datatable .= '<div id="lti_divcurrsecret_'.$i.'" style="display:inline-block" /><span class="LC_nobreak">'.
+                        $datatable .= '<div id="lti_divcurrsecret_'.$i.'" style="display: inline-block;"><span class="LC_nobreak">'.
                                       $lt{'secret'}.': ['.&mt('not shown').'] '.(' 'x2).'</span></div>'.
                                       '<span class="LC_nobreak">'.&mt('Change secret?').
                                       '<label><input type="radio" value="0" name="lti_changesecret_'.$i.'" onclick="javascript:toggleChgSecret(this.form,'."'$i','secret','lti'".');" checked="checked" />'.&mt('No').'</label>'.
                                       (' 'x2).
                                      '<label><input type="radio" value="1" name="lti_changesecret_'.$i.'" onclick="javascript:toggleChgSecret(this.form,'."'$i','secret','lti'".');" />'.&mt('Yes').'</label>'.(' 'x2).
-                                      '</span><div id="lti_divchgsecret_'.$i.'" style="display:none" />'.
+                                      '</span><div id="lti_divchgsecret_'.$i.'" style="display: none;">'.
                                       '<span class="LC_nobreak"> - '.$switchmessage.'</span>'.
                                       '</div>';
                     } elsif ($key eq '') {
@@ -6374,21 +6587,21 @@
                     }
                 } else {
                     if ($usable ne '') {
-                        $datatable .= '<div id="lti_divcurrsecret_'.$i.'" style="display:inline-block" /><span class="LC_nobreak">'.
+                        $datatable .= '<div id="lti_divcurrsecret_'.$i.'" style="display: inline-block;"><span class="LC_nobreak">'.
                                       $lt{'secret'}.': ['.&mt('not shown').'] '.(' 'x2).'</span></div>'.
                                       '<span class="LC_nobreak">'.&mt('Change?').
                                       '<label><input type="radio" value="0" name="lti_changesecret_'.$i.'" onclick="javascript:toggleChgSecret(this.form,'."'$i','secret','lti'".');" checked="checked" />'.&mt('No').'</label>'.
                                       (' 'x2).
                                       '<label><input type="radio" value="1" name="lti_changesecret_'.$i.'" onclick="javascript:toggleChgSecret(this.form,'."'$i','secret','lti'".');" />'.&mt('Yes').
-                                      '</label>  </span><div id="lti_divchgsecret_'.$i.'" style="display:none" />'.
-                                      '<span class="LC_nobreak">'.&mt('New Secret').':'.
-                                      '<input type="password" size="20" name="lti_secret_'.$i.'" value="" autocomplete="new-password" />'.
-                                      '<label><input type="checkbox" name="lti_visible_'.$i.'" id="lti_visible_'.$i.'" onclick="if (this.checked) { this.form.lti_secret_'.$i.'.type='."'text'".' } else { this.form.lti_secret_'.$i.'.type='."'password'".' }" />'.&mt('Visible input').'</label></span></div>';
+                                      '</label>  </span><div id="lti_divchgsecret_'.$i.'" style="display: none;">'.
+                                      '<span class="LC_nobreak"><label>'.&mt('New Secret').':'.
+                                      '<input type="password" size="20" name="lti_secret_'.$i.'" value="" autocomplete="new-password" /></label>'.
+                                      ' <label><input type="checkbox" name="lti_visible_'.$i.'" id="lti_visible_'.$i.'" onclick="if (this.checked) { this.form.lti_secret_'.$i.'.type='."'text'".' } else { this.form.lti_secret_'.$i.'.type='."'password'".' }" />'.&mt('Visible input').'</label></span></div>';
                     } else {
                         $datatable .=
-                            '<span class="LC_nobreak">'.$lt{'secret'}.':'.
-                            '<input type="password" size="20" name="lti_secret_'.$i.'" value="" autocomplete="new-password" />'.
-                            '<label><input type="checkbox" name="lti_visible_'.$i.'" id="lti_visible_'.$i.'" onclick="if (this.checked) { this.form.lti_secret_'.$i.'.type='."'text'".' } else { this.form.lti_secret_'.$i.'.type='."'password'".' }" />'.&mt('Visible input').'</label>';
+                            '<span class="LC_nobreak"><label>'.$lt{'secret'}.':'.
+                            '<input type="password" size="20" name="lti_secret_'.$i.'" value="" autocomplete="new-password" /></label>'.
+                            ' <label><input type="checkbox" name="lti_visible_'.$i.'" id="lti_visible_'.$i.'" onclick="if (this.checked) { this.form.lti_secret_'.$i.'.type='."'text'".' } else { this.form.lti_secret_'.$i.'.type='."'password'".' }" />'.&mt('Visible input').'</label></span>';
                     }
                 }
                 $datatable .= '<br /><br />'.
@@ -6400,7 +6613,7 @@
                     '<label><input type="radio" name="lti_crsinc_'.$i.'" value="1"'.$onclickcrsinc.$checkedcrsinc{yes}.' />'.&mt('Yes').'</label> '."\n".
                     '<label><input type="radio" name="lti_crsinc_'.$i.'" value="0"'.$onclickcrsinc.$checkedcrsinc{no}.' />'.&mt('No').'</label></span>'."\n".
                     (' 'x4).
-                    '<input type="hidden" name="lti_id_'.$i.'" value="'.$item.'" /></span>'.
+                    '<input type="hidden" name="lti_id_'.$i.'" value="'.$item.'" />'.
                     '</fieldset>'.&lti_options($i,$current,$itemcount,%lt).'</td></tr>';
                 $itemcount ++;
             }
@@ -6409,7 +6622,7 @@
         my $chgstr = ' onchange="javascript:reorderLTI(this.form,'."'lti_pos_add'".');"';
         $datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">'."\n".
                       '<input type="hidden" name="lti_maxnum" value="'.$maxnum.'" />'."\n".
-                      '<select name="lti_pos_add"'.$chgstr.'>';
+                      '<select name="lti_pos_add"'.$chgstr.' aria-label="'.&mt('Set list order for new LTI consumer').'">';
         for (my $k=0; $k<$maxnum+1; $k++) {
             my $vpos = $k+1;
             my $selstr;
@@ -6419,23 +6632,23 @@
             $datatable .= '<option value="'.$k.'"'.$selstr.'>'.$vpos.'</option>';
         }
         $datatable .= '</select> '."\n".
-                      '<input type="checkbox" name="lti_add" value="1" />'.&mt('Add').'</span></td>'."\n".
+                      '<label><input type="checkbox" name="lti_add" value="1" />'.&mt('Add').'</label></span></td>'."\n".
                       '<td colspan="2">'.
                       '<fieldset><legend>'.&mt('Required settings').'</legend>'.
-                      '<span class="LC_nobreak">'.$lt{'consumer'}.
-                      ':<input type="text" size="15" name="lti_consumer_add" value="" /></span> '."\n".
+                      '<span class="LC_nobreak"><label>'.$lt{'consumer'}.
+                      ':<input type="text" size="15" name="lti_consumer_add" value="" /></label></span> '."\n".
                       (' 'x2).
-                      '<span class="LC_nobreak">'.$lt{'version'}.':<select name="lti_version_add">'.
+                      '<span class="LC_nobreak"><label for="lti_version_add">'.$lt{'version'}.'</label>:<select name="lti_version_add" id="lti_version_add">'.
                       '<option value="LTI-1p0" selected="selected">1.1</option></select></span> '."\n".
                       (' 'x2).
-                      '<span class="LC_nobreak">'.$lt{'lifetime'}.':<input type="text" size="3" name="lti_lifetime_add" value="300" /></span><br /><br />'."\n";
+                      '<span class="LC_nobreak"><label>'.$lt{'lifetime'}.':<input type="text" size="3" name="lti_lifetime_add" value="300" /></label></span><br /><br />'."\n";
         if ($switchserver) {
             $datatable .= '<span class="LC_nobreak">'.&mt('Key and Secret are required').' - '.$switchmessage.'</span>'."\n";
         } else {
-            $datatable .= '<span class="LC_nobreak">'.$lt{'key'}.':<input type="text" size="25" name="lti_key_add" value="" autocomplete="off" /></span> '."\n".
+            $datatable .= '<span class="LC_nobreak"><label>'.$lt{'key'}.':<input type="text" size="25" name="lti_key_add" value="" autocomplete="off" /></label></span> '."\n".
                           (' 'x2).
-                          '<span class="LC_nobreak">'.$lt{'secret'}.':<input type="password" size="20" name="lti_secret_add" value="" autocomplete="new-password" />'.
-                          '<label><input type="checkbox" name="lti_add_visible" id="lti_add_visible" onclick="if (this.checked) { this.form.lti_secret_add.type='."'text'".' } else { this.form.lti_secret_add.type='."'password'".' }" />'.&mt('Visible input').'</label></span> '."\n";
+                          '<span class="LC_nobreak"><label>'.$lt{'secret'}.':<input type="password" size="20" name="lti_secret_add" value="" autocomplete="new-password" /></label>'.
+                          ' <label><input type="checkbox" name="lti_add_visible" id="lti_add_visible" onclick="if (this.checked) { this.form.lti_secret_add.type='."'text'".' } else { this.form.lti_secret_add.type='."'password'".' }" />'.&mt('Visible input').'</label></span> '."\n";
         }
         $datatable .= '<br /><br />'.
                       '<span class="LC_nobreak">'.$lt{'requser'}.':'.
@@ -6501,7 +6714,7 @@
     my $optionsty = 'block';
     my $crssty = 'block';
     my $lcauthparm;
-    my $lcauthparmstyle = 'display:none';
+    my $lcauthparmstyle = 'display: none;';
     my $lcauthparmtext;
     my $menusty;
     my $numinrow = 4;
@@ -6656,9 +6869,9 @@
                  '<label><input type="radio" name="lti_callback_'.$num.'" value="1"'.
                  $checked{'callback'}{'Y'}.$onclickcallback.' />'.&mt('Yes').'</label></span></div>'.
                  '<div class="LC_floatleft" style="display:'.$callbacksty.';" id="lti_callbackfield_'.$num.'">'.
-                 '<span class="LC_nobreak">'.&mt('Parameter').': '.
-                 '<input type="text" name="lti_callbackparam_'.$num.'" value="'.$callback.'" /></span>'.
-                 '</div><div style="padding:0;clear:both;margin:0;border:0"></div></fieldset>'.
+                 '<span class="LC_nobreak"><label>'.&mt('Parameter').': '.
+                 '<input type="text" name="lti_callbackparam_'.$num.'" value="'.$callback.'" /></label></span>'.
+                 '</div><div style="padding:0;clear:both;margin:0;border:0;"></div></fieldset>'.
                  '<fieldset class="ltioption_usr_'.$num.'" style="display:'.$optionsty.'"><legend>'.&mt('Mapping users').'</legend>'.
                  '<div class="LC_floatleft"><span class="LC_nobreak">'.&mt('LON-CAPA username').': ';
     foreach my $option ('sourcedid','email','other') {
@@ -6669,8 +6882,8 @@
     $output .= '</span></div>'.
                '<div class="LC_floatleft" style="display:'.$userfieldsty.';" id="lti_userfield_'.$num.'">'.
                '<input type="text" name="lti_customuser_'.$num.'" '.
-               'value="'.$userfield.'" /></div></fieldset>'.
-               '<fieldset class="ltioption_usr_'.$num.'" style="display:'.$optionsty.'"><legend>'.&mt('Roles which may create user accounts').'</legend>';
+               'value="'.$userfield.'" aria-label="'.&mt('username item in LTI payload').'" /></div></fieldset>'.
+               '<fieldset class="ltioption_usr_'.$num.'" style="display:'.$optionsty.'; line-height: 185%;"><legend>'.&mt('Roles which may create user accounts').'</legend>';
     foreach my $ltirole (@ltiroles) {
         $output .= '<span class="LC_nobreak"><label><input type="checkbox" name="lti_makeuser_'.$num.'" value="'.$ltirole.'"'.
                    $checked{'makeuser'}{$ltirole}.' />'.$ltirole.'</label> </span> ';
@@ -6680,7 +6893,7 @@
                '<table>'.
                &modifiable_userdata_row('lti','instdata_'.$num,$current,$numinrow,$itemcount).
                '</table>'.
-               '<table class="LC_nested"><tr><td class="LC_left_item">LON-CAPA Authentication</td>'.
+               '<table class="LC_nested"><tr><th class="LC_rowheader LC_left_item" scope="row">LON-CAPA Authentication</th>'.
                '<td class="LC_left_item">';
     foreach my $auth ('lti', at authtypes) {
         my $authtext;
@@ -6697,7 +6910,7 @@
                '<tr id="lti_lcauth_parmrow_'.$num.'" style="'.$lcauthparmstyle.'">'.
                '<td class="LC_right_item" colspan="2"><span class="LC_nobreak">'.
                '<span id="lti_lcauth_parmtext_'.$num.'">'.$lcauthparmtext.'</span>'.
-               '<input type="text" name="lti_lcauthparm_'.$num.'" value="" /></span></td></tr>'.
+               '<input type="text" name="lti_lcauthparm_'.$num.'" value="" aria-label="'.&mt('LON-CAPA Authentication parameter').'" /></span></td></tr>'.
                '</table></fieldset>'.
                '<fieldset class="ltioption_usr_'.$num.'" style="display:'.$optionsty.'"><legend>'.
                &mt('LON-CAPA menu items (Course Coordinator can override)').'</legend>'.
@@ -6730,7 +6943,7 @@
                    ($option eq 'other' ? '' : (' 'x2) );
     }
     $output .= '</span></div><div class="LC_floatleft" style="display:'.$crsfieldsty.';" id="lti_crsfield_'.$num.'">'.
-               '<input type="text" name="lti_mapcrsfield_'.$num.'" value="'.$cidfield.'" />'.
+               '<input type="text" name="lti_mapcrsfield_'.$num.'" value="'.$cidfield.'" aria-label="'.&mt('course identifier in LTI payload').'" />'.
                '</div><div style="padding:0;clear:both;margin:0;border:0"></div>'.
                '<span class="LC_nobreak">'.&mt('LON-CAPA course type(s)').': ';
     foreach my $type (@coursetypes) {
@@ -6745,14 +6958,17 @@
                '<label><input type="radio" name="lti_storecrs_'.$num.'" value="1"'.
                $checked{'storecrs'}{'Y'}.' />'.&mt('Yes').'</label></span>'.
                '</fieldset>'.
-               '<fieldset class="ltioption_crs_'.$num.'" style="display:'.$crssty.'"><legend>'.&mt('Mapping course roles').'</legend><table><tr>';
+               '<fieldset class="ltioption_crs_'.$num.'" style="display:'.$crssty.'">'.
+               '<legend>'.&mt('Mapping course roles').'</legend>'.
+               '<div class="LC_grid" role="grid" style="margin: 0;">'.
+	       '<div class="LC_grid_row" role="row">';
     foreach my $ltirole (@lticourseroles) {
         my ($selected,$selectnone);
         if ($rolemaps{$ltirole} eq '') {
             $selectnone = ' selected="selected"';
         }
-        $output .= '<td style="text-align: center">'.$ltirole.'<br />'.
-                   '<select name="lti_maprole_'.$ltirole.'_'.$num.'">'.
+        $output .= '<div class="LC_grid_cell" role="gridcell" style="text-align: center">'.$ltirole.'<br />'.
+                   '<select name="lti_maprole_'.$ltirole.'_'.$num.'" aria-label="'.$ltirole.'">'.
                    '<option value=""'.$selectnone.'>'.&mt('Select').'</option>';
         foreach my $role (@courseroles) {
             unless ($selectnone) {
@@ -6766,9 +6982,9 @@
                        &Apache::lonnet::plaintext($role,'Course').
                        '</option>';
         }
-        $output .= '</select></td>';
+        $output .= '</select></div>';
     }
-    $output .= '</tr></table></fieldset>'.
+    $output .= '</div></div></fieldset>'.
                '<fieldset class="ltioption_crs_'.$num.'" style="display:'.$crssty.'"><legend>'.&mt('Creating courses').'</legend>'.
                '<span class="LC_nobreak">'.&mt('Course created (if absent) on Instructor access').': '.
                '<label><input type="radio" name="lti_makecrs_'.$num.'" value="0"'.
@@ -6796,7 +7012,7 @@
                '<label><input type="radio" name="lti_crssecsrc_'.$num.'" value="other"'.
                $checked{'crssecsrc'}{'other'}.$onclicksecsrc.' />'.&mt('Other').
                '</label></span></div><div class="LC_floatleft" style="display:'.$secsrcfieldsty.';" id="lti_secsrcfield_'.$num.'">'.
-               '<input type="text" name="lti_customsection_'.$num.'" value="'.$crssecsrc.'" />'.
+               '<input type="text" name="lti_customsection_'.$num.'" value="'.$crssecsrc.'" aria-label="'.&mt('section identifier in LTI payload').'" />'.
                '</div><div style="padding:0;clear:both;margin:0;border:0"></div>';
     my ($pb1p1chk,$pb1p0chk,$onclickpb);
     foreach my $extra ('roster','passback') {
@@ -6835,7 +7051,7 @@
                '<label><input type="radio" name="lti_passbackformat_'.$num.'" value="1.0"'.$pb1p0chk.'/>'.
                &mt('Outcomes Extension (1.0)').'</label></span></div>'.
                '<div style="padding:0;clear:both;margin:0;border:0"></div></fieldset>';
-    $output .= '</span></div></fieldset>';
+	       #    $output .= '</span></div></fieldset>';
 #        '<fieldset><legend>'.&mt('Assigning author roles').'</legend>';
 #
 #    $output .= '</fieldset>'.
@@ -6879,10 +7095,10 @@
                 '<label><input type="checkbox" name="linkprot_suggested_del" value="'.$i.'" />'."\n".
                 &mt('Delete?').'</label></span></td><td>'."\n".
                 '<div class="LC_floatleft"><fieldset><legend>'.$lt{'name'}.'</legend>'."\n".
-                '<input type="text" size="15" name="linkprot_suggested_name_'.$i.'" value="'.$values{'name'}.'" autocomplete="off" />'."\n".
+                '<input type="text" size="15" name="linkprot_suggested_name_'.$i.'" value="'.$values{'name'}.'" autocomplete="off" aria-label="'.$lt{'name'}.'" />'."\n".
                 '</fieldset></div>'.
                 '<div class="LC_floatleft"><fieldset><legend>'.$lt{'info'}.'</legend>'."\n".
-                '<textarea cols="55" rows="5" name="linkprot_suggested_info_'.$i.'">'.$values{'info'}.'</textarea>'.
+                '<textarea cols="55" rows="5" name="linkprot_suggested_info_'.$i.'" aria-label="'.$lt{'info'}.'">'.$values{'info'}.'</textarea>'.
                 '</fieldset></div>'.
                 '<div style="padding:0;clear:both;margin:0;border:0"></div>'."\n".
                 '<input type="hidden" name="linkprot_suggested_id_'.$i.'" value="'.$num.'" /></td></tr>'."\n";
@@ -6892,13 +7108,13 @@
     $css_class = $$itemcount%2?' class="LC_odd_row"':'';
     $datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">'."\n".
                   '<input type="hidden" name="linkprot_suggested_maxnum" value="'.$next.'" />'."\n".
-                  '<input type="checkbox" name="linkprot_suggested_add" value="1" />'.&mt('Add').'</span></td>'."\n".
+                  '<label><input type="checkbox" name="linkprot_suggested_add" value="1" />'.&mt('Add').'</label></span></td>'."\n".
                   '<td>'."\n".
                   '<div class="LC_floatleft"><fieldset><legend>'.$lt{'name'}.'</legend>'."\n".
-                  '<input type="text" size="15" name="linkprot_suggested_name_add" value="" autocomplete="off" />'."\n".
+                  '<input type="text" size="15" name="linkprot_suggested_name_add" value="" autocomplete="off" aria-label="'.$lt{'name'}.'"/>'."\n".
                   '</fieldset></div>'.
                   '<div class="LC_floatleft"><fieldset><legend>'.$lt{'info'}.'</legend>'."\n".
-                  '<textarea cols="55" rows="5" name="linkprot_suggested_info_add"></textarea>'.
+                  '<textarea cols="55" rows="5" name="linkprot_suggested_info_add" aria-label="'.$lt{'info'}.'"></textarea>'.
                   '</fieldset></div>'.
                   '<div style="padding:0;clear:both;margin:0;border:0"></div>'."\n".
                   '</td></tr>'."\n";
@@ -6966,9 +7182,10 @@
         }
         $css_class = $itemcount%2?' class="LC_odd_row"':'';
         my $mathdisp = '<tr'.$css_class.'><td style="vertical-align: top">'.
-                       '<span class="LC_nobreak">'.$choices{'texengine'}.
+                       '<span class="LC_nobreak">'.
+                       '<label for="texengine">'.$choices{'texengine'}.'</label>'.
                        '</span></td><td class="LC_right_item">'.
-                       '<select name="texengine">'."\n";
+                       '<select name="texengine" id="texengine">'."\n";
         my %texoptions = (
                             MathJax  => 'MathJax',
                             mimetex  => &mt('Convert to Images'),
@@ -7000,21 +7217,24 @@
                 '<tr'.$css_class.'><td><span class="LC_nobreak">'.
                 $choices{'canuse_pdfforms'}.
                 '</span></td>'.
-                '<td class="LC_left_item"><span class="LC_nobreak">';
+                '<td class="LC_left_item">'.
+                '<fieldset class="LC_borderless" style="line-height: 185%;">'.
+                '<legend class="LC_visually_hidden">'.$choices{'canuse_pdfforms'}.'</legend>'.
+		'<span class="LC_nobreak">';
         foreach my $option ('2','1','0') {
             $datatable .= '<label><input type="radio" name="canuse_pdfforms"'.
                           ' value="'.$option.'"'.$checkedpdf{$option}.' />'.
                           $pdftext{$option}.'</label>'.($option? '<br />' : '');
         }
-        $datatable .= '</span></td></tr>'."\n";
+        $datatable .= '</span></fieldset></td></tr>'."\n";
         $itemcount ++;
         $css_class = $itemcount%2?' class="LC_odd_row"':'';
         $datatable .=
                 '<tr'.$css_class.'><td><span class="LC_nobreak">'.
-                $choices{'maxsizepdfform'}.
-                '</span></td>'.
+                '<label for="maxsizepdfform">'.$choices{'maxsizepdfform'}.
+                '</label></span></td>'.
                 '<td class="LC_left_item"><span class="LC_nobreak">'.
-                '<input type="text" name="maxsizepdfform"'.
+                '<input type="text" name="maxsizepdfform" id="maxsizepdfform"'.
                 ' value="'.$currmaxsizepdf.'" size="5" /></span>'.
                 '</td></tr>'."\n";
         $itemcount ++;
@@ -7022,7 +7242,9 @@
         $datatable .=
             '<tr'.$css_class.'><td style="vertical-align: top">'.
             '<span class="LC_nobreak">'.$choices{'canclone'}.
-            '</span></td><td class="LC_left_item">';
+            '</span></td><td class="LC_left_item">'.
+            '<fieldset class="LC_borderless" style="line-height: 185%;">'.
+            '<legend class="LC_visually_hidden">'.$choices{'canclone'}.'</legend>';
         my $currcanclone = 'none';
         my $onclick;
         my @cloneoptions = ('none','domain');
@@ -7086,7 +7308,8 @@
                 ' value="'.$option.'"'.$onclick.' />'.$clonetitles{$option}.
                 '</label> '.$additional.'</span><br />';
         }
-        $datatable .= '</td>'.
+        $datatable .= '</fieldset>'.
+                      '</td>'.
                       '</tr>';
         $itemcount ++;
     } else {
@@ -7229,10 +7452,10 @@
         }
         $datatable .=
                 '<tr'.$css_class.'><td><span class="LC_nobreak">'.
-                $choices{'anonsurvey_threshold'}.
-                '</span></td>'.
+                '<label for="anonsurvey_threshold">'.$choices{'anonsurvey_threshold'}.
+                '</label></span></td>'.
                 '<td class="LC_right_item"><span class="LC_nobreak">'.
-                '<input type="text" name="anonsurvey_threshold"'.
+                '<input type="text" name="anonsurvey_threshold" id="anonsurvey_threshold"'.
                 ' value="'.$currdefresponder.'" size="5" /></span>'.
                 '</td></tr>'."\n";
         $itemcount ++;
@@ -7240,27 +7463,33 @@
         $datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'.
                       $choices{'uploadquota'}.
                       '</span></td>'.
-                      '<td style="text-align: right" class="LC_right_item">'.
-                      '<table><tr>';
+                      '<td style="text-align: left" class="LC_right_left">'.
+                      '<fieldset class="LC_borderless">'.
+                      '<legend class="LC_visually_hidden">'.$choices{'uploadquota'}.'</legend>'.
+                      '<div class="LC_grid" role="grid" style="margin: 0;">'.
+                      '<div class="LC_grid_row" role="row">';
         foreach my $type (@types) {
-            $datatable .= '<td style="text-align: center">'.&mt($type).'<br />'.
+            $datatable .= '<div class="LC_grid_cell" role="gridcell" style="text-align: center">'.
+                          '<label>'.&mt($type).'<br />'.
                            '<input type="text" name="uploadquota_'.$type.'"'.
-                           ' value="'.$curruploadquota{$type}.'" size="5" /></td>';
+                           ' value="'.$curruploadquota{$type}.'" size="5" /></label></div>';
         }
-        $datatable .= '</tr></table></td></tr>'."\n";
+        $datatable .= '</div></div></fieldset></td></tr>'."\n";
         $itemcount ++;
         $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
         $datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'.
                       $choices{'coursequota'}.
                       '</span></td>'.
                       '<td style="text-align: right" class="LC_right_item">'.
-                      '<table><tr>';
+                      '<div class="LC_grid" role="grid" style="margin: 0;">'.
+                      '<div class="LC_grid_row" role="row">';
         foreach my $type (@types) {
-            $datatable .= '<td style="text-align: center">'.&mt($type).'<br />'.
+            $datatable .= '<div class="LC_grid_cell" role="gridcell" style="text-align: center">'.
+                          '<label>'.&mt($type).'<br />'.
                            '<input type="text" name="coursequota_'.$type.'"'.
-                           ' value="'.$currcoursequota{$type}.'" size="5" /></td>';
+                           ' value="'.$currcoursequota{$type}.'" size="5" /></label></div>';
         }
-        $datatable .= '</tr></table></td></tr>'."\n";
+        $datatable .= '</div></div></td></tr>'."\n";
         $itemcount ++;
         my $onclick = "toggleDisplay(this.form,'credits');";
         my $display = 'none';
@@ -7268,14 +7497,17 @@
             $display = 'block';
         }
         my $additional = '<div id="credits" style="display: '.$display.'">'.
-                         '<i>'.&mt('Default credits').'</i><br /><table><tr>';
+                         '<i>'.&mt('Default credits').'</i><br />'.
+                         '<div class="LC_grid" role="grid" style="margin: 0;">'.
+                         '<div class="LC_grid_row" role="row">';
         foreach my $type (@types) {
             next if ($type eq 'community');
-            $additional .= '<td style="text-align: center">'.&mt($type).'<br />'.
+            $additional .= '<div class="LC_grid_cell" role="gridcell" style="text-align: center">'.
+                           '<label>'.&mt($type).'<br />'.
                            '<input type="text" name="'.$type.'_credits"'.
-                           ' value="'.$defcredits{$type}.'" size="3" /></td>';
+                           ' value="'.$defcredits{$type}.'" size="3" /></label></div>';
         }
-        $additional .= '</tr></table></div>'."\n";
+        $additional .= '</div></div></div>'."\n";
         %defaultchecked = ('coursecredits' => 'off');
         @toggles = ('coursecredits');
         my $current = {
@@ -7283,7 +7515,7 @@
                       };
         (my $table,$itemcount) =
             &radiobutton_prefs($current,\@toggles,\%defaultchecked,
-                               \%choices,$itemcount,$onclick,$additional,'left');
+                               \%choices,$itemcount,$onclick,$additional,'left','',185);
         $datatable .= $table;
         $onclick = "toggleDisplay(this.form,'studentsubmission');";
         my $display = 'none';
@@ -7293,13 +7525,15 @@
         $additional = '<div id="studentsubmission" style="display: '.$display.'">'.
                       &mt('Number of seconds submit is disabled').'<br />'.
                       '<i>'.&mt('Enter 0 to remain disabled until page reload.').'</i><br />'.
-                      '<table><tr>';
+                      '<div class="LC_grid" role="grid" style="margin: 0;">'.
+                      '<div class="LC_grid_row" role="row">';
         foreach my $type (@types) {
-            $additional .= '<td style="text-align: center">'.&mt($type).'<br />'.
+            $additional .= '<div class="LC_grid_cell" role="gridcell" style="text-align: center">'.
+                           '<label>'.&mt($type).'<br />'.
                            '<input type="text" name="'.$type.'_timeout" value="'.
-                           $deftimeout{$type}.'" size="5" /></td>';
+                           $deftimeout{$type}.'" size="5" /></label></div>';
         }
-        $additional .= '</tr></table></div>'."\n";
+        $additional .= '</div></div></div>'."\n";
         %defaultchecked = ('postsubmit' => 'on');
         @toggles = ('postsubmit');
         $current = {
@@ -7307,20 +7541,22 @@
                    };
         ($table,$itemcount) =
             &radiobutton_prefs($current,\@toggles,\%defaultchecked,
-                               \%choices,$itemcount,$onclick,$additional,'left');
+                               \%choices,$itemcount,$onclick,$additional,'left','',185);
         $datatable .= $table;
         $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
         $datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'.
                       $choices{'mysqltables'}.
                       '</span></td>'.
                       '<td style="text-align: right" class="LC_right_item">'.
-                      '<table><tr>';
+                      '<div class="LC_grid" role="grid" style="margin: 0;">'.
+                      '<div class="LC_grid_row" role="row">';
         foreach my $type (@types) {
-            $datatable .= '<td style="text-align: center">'.&mt($type).'<br />'.
-                           '<input type="text" name="mysqltables_'.$type.'"'.
-                           ' value="'.$currmysql{$type}.'" size="8" /></td>';
+            $datatable .= '<div class="LC_grid_cell" role="gridcell" style="text-align: center">'.
+                          '<label>'.&mt($type).'<br />'.
+                          '<input type="text" name="mysqltables_'.$type.'"'.
+                          ' value="'.$currmysql{$type}.'" size="8" /></label></div>';
         }
-        $datatable .= '</tr></table></td></tr>'."\n";
+        $datatable .= '</div></div></td></tr>'."\n";
         $itemcount ++;
         %defaultchecked = ('ltiauth' => 'off');
         @toggles = ('ltiauth');
@@ -7336,62 +7572,74 @@
                       $choices{'domexttool'}.
                       '</span></td>'.
                       '<td style="text-align: right" class="LC_right_item">'.
-                      '<table><tr>';
+                      '<fieldset class="LC_borderless">'.
+                      '<legend class="LC_visually_hidden">'.$choices{'domexttool'}.'</legend>'.
+                      '<div class="LC_grid" role="grid" style="margin: 0;">'.
+                      '<div class="LC_grid_row" role="row">';
         foreach my $type (@types) {
-            $datatable .= '<td style="text-align: left">'.
+            $datatable .= '<div class="LC_grid_cell" role="gridcell" style="text-align: left">'.
                           '<span class="LC_nobreak">'.
                           '<label><input type="checkbox" name="domexttool"'.
                           ' value="'.$type.'"'.$domexttool{$type}.' />'.
-                          &mt($type).'</label></span></td>'."\n";
+                          &mt($type).'</label></span></div>'."\n";
         }
-        $datatable .= '</tr></table></td></tr>'."\n";
+        $datatable .= '</div></div></fieldset></td></tr>'."\n";
         $itemcount ++;
         $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
         $datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'.
                       $choices{'exttool'}.
                       '</span></td>'.
                       '<td style="text-align: right" class="LC_right_item">'.
-                      '<table><tr>';
+                      '<fieldset class="LC_borderless">'.
+                      '<legend class="LC_visually_hidden">'.$choices{'exttool'}.'</legend>'.
+                      '<div class="LC_grid" role="grid" style="margin: 0;">'.
+                      '<div class="LC_grid_row" role="row">';
         foreach my $type (@types) {
-            $datatable .= '<td style="text-align: left">'.
+            $datatable .= '<div class="LC_grid_cell" role="gridcell" style="text-align: left">'.
                           '<span class="LC_nobreak">'.
                           '<label><input type="checkbox" name="exttool"'.
                           ' value="'.$type.'"'.$exttool{$type}.' />'.
-                          &mt($type).'</label></span></td>'."\n";
+                          &mt($type).'</label></span></div>'."\n";
         }
-        $datatable .= '</tr></table></td></tr>'."\n";
+        $datatable .= '</div></div></fieldset></td></tr>'."\n";
         $itemcount ++;
         $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
         $datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'.
                       $choices{'crsauthor'}.
                       '</span></td>'.
                       '<td style="text-align: right" class="LC_right_item">'.
-                      '<table><tr>';
+                      '<fieldset class="LC_borderless">'.
+                      '<legend class="LC_visually_hidden">'.$choices{'crsauthor'}.'</legend>'.
+                      '<div class="LC_grid" role="grid" style="margin: 0;">'.
+                      '<div class="LC_grid_row" role="row">';
         foreach my $type (@types) {
-            $datatable .= '<td style="text-align: left">'.
+            $datatable .= '<div class="LC_grid_cell" role="gridcell" style="text-align: left">'.
                           '<span class="LC_nobreak">'.
                           '<label><input type="checkbox" name="crsauthor"'.
                           ' value="'.$type.'"'.$crsauthor{$type}.' />'.
-                          &mt($type).'</label></span></td>'."\n";
+                          &mt($type).'</label></span></div>'."\n";
         }
-        $datatable .= '</tr></table></td></tr>'."\n";
+        $datatable .= '</div></div></fieldset></td></tr>'."\n";
         $itemcount ++;
         $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
         $datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'.
                       $choices{'crseditors'}.
                       '</span></td>'.
                       '<td style="text-align: right" class="LC_right_item">'.
-                      '<table><tr>';
+                      '<fieldset class="LC_borderless">'.
+                      '<legend class="LC_visually_hidden">'.$choices{'crseditors'}.'</legend>'.
+                      '<div class="LC_grid" role="grid" style="margin: 0;">'.
+                      '<div class="LC_grid_row" role="row">';
         my @editors = ('edit','xml','daxe');
         my %editornames = &crseditor_titles();
         foreach my $editor (@editors) {
-            $datatable .= '<td style="text-align: left">'.
+            $datatable .= '<div class="LC_grid_cell" role="gridcell" style="text-align: left">'.
                           '<span class="LC_nobreak">'.
                           '<label><input type="checkbox" name="crseditors"'.
                           ' value="'.$editor.'"'.$crseditors{$editor}.' />'.
-                          $editornames{$editor}.'</label></span></td>'."\n";
+                          $editornames{$editor}.'</label></span></div>'."\n";
         }
-        $datatable .= '</tr></table></td></tr>'."\n";
+        $datatable .= '</div></div></fieldset></td></tr>'."\n";
     }
     $$rowtotal += $itemcount;
     return $datatable;
@@ -7434,18 +7682,18 @@
             }
         }
         $datatable .= '<tr'.$css_class.'><td style="vertical-align: top">'.
-                      '<span class="LC_nobreak">'.$titles{'copyright'}.
-                      '</span></td><td class="LC_right_item">'.
-                      &selectbox('copyright',$currrights{'copyright'},'',
+                      '<span class="LC_nobreak"><label for="copyright">'.$titles{'copyright'}.
+                      '</label></span></td><td class="LC_right_item">'.
+                      &selectbox('copyright','copyright',$currrights{'copyright'},'',
                                  \&Apache::loncommon::copyrightdescription,
                                  (grep !/^priv|custom$/,(&Apache::loncommon::copyrightids))).
                       '</td></tr>'."\n";
         $itemcount ++;
         $css_class = $itemcount%2?' class="LC_odd_row"':'';
         $datatable .= '<tr'.$css_class.'><td style="vertical-align: top">'.
-                      '<span class="LC_nobreak">'.$titles{'sourceavail'}.
-                      '</span></td><td class="LC_right_item">'.
-                      &selectbox('sourceavail',$currrights{'sourceavail'},'',
+                      '<span class="LC_nobreak"><label for="sourceavail">'.$titles{'sourceavail'}.
+                      '</label></span></td><td class="LC_right_item">'.
+                      &selectbox('sourceavail','sourceavail',$currrights{'sourceavail'},'',
                                  \&Apache::loncommon::source_copyrightdescription,
                                  (&Apache::loncommon::source_copyrightids)).
                       '</td></tr>'."\n";        
@@ -7468,6 +7716,8 @@
         $datatable = '<tr'.$css_class.'>'."\n".
                      '<td>'.$titles{'editors'}.'</td>'."\n".
                      '<td class="LC_left_item">'."\n".
+                     '<fieldset class="LC_borderless">'."\n".
+                     '<legend class="LC_visually_hidden">'.$titles{'editors'}.'</legend>'."\n".
                      '<span class="LC_nobreak">';
         foreach my $editor (@editors) {
             my $checked;
@@ -7480,7 +7730,7 @@
                           'onclick="javascript:checkEditors(this.form,'."'author_editors'".',this);" />'.
                           $titles{$editor}.'</label> ';
         }
-        $datatable .= '</span>'."\n".'</td>'."\n".'</tr>'."\n";
+        $datatable .= '</span></fieldset>'."\n".'</td>'."\n".'</tr>'."\n";
         $itemcount ++;
         $css_class = $itemcount%2?' class="LC_odd_row"':'';
         my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom);
@@ -7549,7 +7799,9 @@
                       '<td>'.$titles{'webdav_LC_adv'}.'<br />'.
                              $titles{'webdav_LC_adv_over'}.
                       '</td>'.
-                      '<td class="LC_left_item">';
+                      '<td class="LC_left_item">'.
+                      '<fieldset class="LC_borderless">'.
+                      '<legend class="LC_visually_hidden">'.$titles{'webdav_LC_adv'}.'</legend>';
         foreach my $option ('none','off','on') {
             my ($text,$val,$checked);
             if ($option eq 'none') {
@@ -7570,7 +7822,7 @@
                           ' value="'.$val.'"'.$checked.' />'.
                           $text.'</label></span>  ';
         }
-        $datatable .= '</td></tr>';
+        $datatable .= '</fieldset></td></tr>';
         $itemcount ++;
         my %defchecked = (
                                 'archive' => 'off',
@@ -7609,17 +7861,21 @@
 }
 
 sub selectbox {
-    my ($name,$value,$readonly,$functionref, at idlist)=@_;
-    my $selout = '<select name="'.$name.'">';
-    foreach my $id (@idlist) {
-        $selout.='<option value="'.$id.'"';
-        if ($id eq $value) {
+    my ($name,$id,$value,$readonly,$functionref, at idlist)=@_;
+    my $selout = '<select name="'.$name.'"';
+    if ($id ne '') {
+        $selout .= ' id="'.$id.'"';    
+    }
+    $selout .= '>'; 
+    foreach my $lid (@idlist) {
+        $selout.='<option value="'.$lid.'"';
+        if ($lid eq $value) {
             $selout.=' selected="selected"';
         }
         if ($readonly) {
             $selout .= ' disabled="disabled"';
         }
-        $selout.='>'.&{$functionref}($id).'</option>';
+        $selout.='>'.&{$functionref}($lid).'</option>';
     }
     $selout.='</select>';
     return $selout;
@@ -7649,7 +7905,7 @@
                 $itemcount ++;
                 $css_class = $itemcount%2?' class="LC_odd_row"':'';
                 $datatable .= '<tr'.$css_class.'>'.
-                              '<td>'.$titlesref->{$row}.'</td>'.
+                              '<th scope="row" class="LC_rowheader">'.$titlesref->{$row}.'</th>'.
                               '<td class="LC_left_item">'.
                               '<table><tr>';
                 my (%current,%currentcap);
@@ -7672,20 +7928,22 @@
                             ); 
             
                 foreach my $type (@types) {
-                    unless (($row eq 'registered') && ($key eq 'default')) {
+		    unless (($row eq 'registered') && ($type ne 'official')) {
                         $datatable .= '<th>'.&mt($type).'</th>';
                     }
                 }
-                unless (($row eq 'registered') && ($key eq 'default')) {
-                    $datatable .= '</tr><tr>';
-                }
+                $datatable .= '</tr><tr>';
                 foreach my $type (@types) {
                     if ($type eq 'community') {
                         $roles{'1'} = &mt('Community personnel');
                     } else {
                         $roles{'1'} = &mt('Course personnel');
                     }
-                    $datatable .= '<td style="vertical-align: top">';
+                    next if (($row eq 'registered') && ($type ne 'official'));
+                    $datatable .= '<td style="vertical-align: top">'.
+                                  '<fieldset class="LC_borderless" style="line-height: 185%;">'.
+                                  '<legend class="LC_visually_hidden">'.
+                                  $titlesref->{$row}.' ['.&mt($type).']</legend>'; 
                     if ($position eq 'top') {
                         my %checked;
                         if ($current{$type} eq '0') {
@@ -7693,11 +7951,15 @@
                         } else {
                             $checked{'1'} = ' checked="checked"';
                         }
+                        my $linefeed;
+                        if ($row eq 'registered') {
+                            $linefeed = '<br />';
+                        }
                         foreach my $role ('1','0') {
                             $datatable .= '<span class="LC_nobreak"><label>'.
                                           '<input type="radio" name="selfenrolladmin_'.$row.'_'.$type.'" '.
                                           'value="'.$role.'"'.$checked{$role}.' />'.
-                                          $roles{$role}.'</label></span> ';
+                                          $roles{$role}.'</label></span> '.$linefeed;
                         }
                     } else {
                         if ($row eq 'types') {
@@ -7713,16 +7975,18 @@
                                               'value="'.$val.'"'.$checked{$val}.' />'.$descs{$row}{$val}.'</label></span> ';
                             }
                         } elsif ($row eq 'registered') {
-                            my %checked;
-                            if ($current{$type} eq '1') {
-                                $checked{'1'} = ' checked="checked"';
-                            } else {
-                                $checked{'0'} = ' checked="checked"';
-                            }
-                            foreach my $val ('0','1') {
-                                $datatable .= '<span class="LC_nobreak"><label>'.
-                                              '<input type ="radio" name="selfenrolldefault_'.$row.'_'.$type.'" '.
-                                              'value="'.$val.'"'.$checked{$val}.' />'.$descs{$row}{$val}.'</label></span> ';
+                            if ($type eq 'official') {
+                                my %checked;
+                                if ($current{$type} eq '1') {
+                                    $checked{'1'} = ' checked="checked"';
+                                } else {
+                                    $checked{'0'} = ' checked="checked"';
+                                }
+                                foreach my $val ('0','1') {
+                                    $datatable .= '<span class="LC_nobreak"><label>'.
+                                                  '<input type ="radio" name="selfenrolldefault_'.$row.'_'.$type.'" '.
+                                                  'value="'.$val.'"'.$checked{$val}.' />'.$descs{$row}{$val}.'</label></span><br />';
+                                }
                             }
                         } elsif ($row eq 'approval') {
                             my %checked;
@@ -7753,12 +8017,12 @@
                                               'value="'.$val.'"'.$checked{$val}.' />'.$descs{$row}{$val}.'</label></span> ';
                             }
                             $datatable .= '<br />'.
-                                          '<span class="LC_nobreak">'.&mt('Maximum allowed: ').
-                                          '<input type="text" name="selfenrolldefault_cap_'.$type.'" size = "5" value="'.$cap.'" />'.
+                                          '<span class="LC_nobreak"><label>'.&mt('Maximum allowed: ').
+                                          '<input type="text" name="selfenrolldefault_cap_'.$type.'" size = "5" value="'.$cap.'" /></label>'.
                                           '</span>'; 
                         }
                     }
-                    $datatable .= '</td>';
+                    $datatable .= '</fieldset></td>';
                 }
                 $datatable .= '</tr>';
             }
@@ -7789,19 +8053,26 @@
     my $itemcount = 0;
     foreach my $item (@{$itemsref}) {
         my $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
-        $datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'.
-                      $namesref->{$item}.
-                      '</span></td>'.
+        $datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">';
+        if ($item eq 'fields') {
+            $datatable .= $namesref->{$item};
+        } else {
+            $datatable .= '<label for="'.$caller.'_validation_'.$item.'">'.$namesref->{$item}.'</label>';
+        }
+        $datatable .= '</span></td>'.
                       '<td class="LC_left_item">';
         if (($item eq 'url') || ($item eq 'button')) {
             $datatable .= '<span class="LC_nobreak">'.
-                          '<input type="text" name="'.$caller.'_validation_'.$item.'"'.
-                          ' value="'.$currvalidation{$item}.'" size="50" /></span>';
+                          '<input type="text" name="'.$caller.'_validation_'.$item.'" '.
+                          'id="'.$caller.'_validation_'.$item.'" '.
+                          'value="'.$currvalidation{$item}.'" size="50" /></span>';
         } elsif ($item eq 'fields') {
             my @currfields;
             if (ref($currvalidation{$item}) eq 'ARRAY') {
                 @currfields = @{$currvalidation{$item}};
             }
+            $datatable .= '<fieldset class="LC_borderless">'.
+                          '<legend class="LC_visually_hidden">'.$namesref->{$item}.'</legend>';
             foreach my $field (@{$fieldsref}) {
                 my $check = '';
                 if (grep(/^\Q$field\E$/, at currfields)) {
@@ -7812,10 +8083,12 @@
                               ' value="'.$field.'"'.$check.' />'.$field.
                               '</label></span> ';
             }
+            $datatable .= '</fieldset>'; 
         } elsif ($item eq 'markup') {
-            $datatable .= '<textarea name="'.$caller.'_validation_markup" cols="50" rows="5">'.
+            $datatable .= '<textarea name="'.$caller.'_validation_markup" '.
+                          'id="'.$caller.'_validation_markup" cols="50" rows="5">'.
                            $currvalidation{$item}.
-                              '</textarea>';
+                           '</textarea>';
         }
         $datatable .= '</td></tr>'."\n";
         if (ref($rowtotal)) {
@@ -7832,8 +8105,9 @@
             }
         }
         my $numinrow = 2;
+        my $legend = &mt('Choose Dom. Coord. who will be listed as course creator');
         my ($numdc,$dctable,$rows) = &active_dc_picker($dom,$numinrow,'radio',
-                                                       'validationdc',%currhash);
+                                                       'validationdc',$legend,%currhash);
         my $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
         $datatable .= '<tr'.$css_class.'><td>';
         if ($numdc > 1) {
@@ -7945,7 +8219,8 @@
                 }
                 $css_class = $itemcount%2?' class="LC_odd_row"':'';
                 my ($numdc,$table,$rows) = &active_dc_picker($dom,$numinrow,'checkbox',
-                                                             'privacy_notify',%curr);
+                                                             'privacy_notify',$titles{'notify'},
+                                                             %curr);
                 if ($numdc > 0) {
                     $datatable .= $table;
                 } else {
@@ -8082,14 +8357,17 @@
         $datatable = &captcha_choice('passwords',$settings,$$rowtotal);
         $itemcount ++;
         $css_class = $itemcount%2?' class="LC_odd_row"':'';
-        $datatable .= '<tr'.$css_class.'><td>'.$titles{'link'}.'</td>'.
+        $datatable .= '<tr'.$css_class.'><td>'.
+                      '<label for="passwords_link">'.$titles{'link'}.'</label></td>'.
                       '<td class="LC_left_item">'.
-                      '<input type="textbox" value="'.$shownlinklife.'" '.
-                      'name="passwords_link" size="3" /></td></tr>';
+                      '<input type="text" value="'.$shownlinklife.'" '.
+                      'name="passwords_link" id="passwords_link" size="3" /></td></tr>';
         $itemcount ++;
         $css_class = $itemcount%2?' class="LC_odd_row"':'';
         $datatable .= '<tr'.$css_class.'><td>'.$titles{'case'}.'</td>'.
-                      '<td class="LC_left_item">';
+                      '<td class="LC_left_item">'.
+                      '<fieldset class="LC_borderless" style="line-height: 170%;">'.
+                      '<legend class="LC_visually_hidden">'.$titles{'case'}.'</legend>';
         if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) {
             foreach my $item (@{$types}) {
                 my $checkedcase;
@@ -8108,7 +8386,7 @@
         }
         $datatable .= '<span class="LC_nobreak"><label><input type="checkbox" '.
                       'name="passwords_case_sensitive" value="default"'.$checkedcase.' />'.
-                      $othertitle.'</label></span></td>';
+                      $othertitle.'</label></span></fieldset></td></tr>';
         $itemcount ++;
         $css_class = $itemcount%2?' class="LC_odd_row"':'';
         my %checkedpre = (
@@ -8120,12 +8398,15 @@
             $checkedpre{both} = '';
         }
         $datatable .= '<tr'.$css_class.'><td>'.$titles{'prelink'}.'</td>'.
-                      '<td class="LC_left_item"><span class="LC_nobreak">'.
+                      '<td class="LC_left_item">'.
+                      '<fieldset class="LC_borderless" style="line-height: 170%;">'.
+                      '<legend class="LC_visually_hidden">'.$titles{'prelink'}.'</legend>'.
+                      '<span class="LC_nobreak">'.
                       '<label><input type="radio" name="passwords_prelink" value="both"'.$checkedpre{'both'}.' />'.
                       &mt('Both username and e-mail address').'</label></span>   '.
                       '<span class="LC_nobreak"><label>'.
                       '<input type="radio" name="passwords_prelink" value="either"'.$checkedpre{'either'}.' />'.
-                      &mt('Either username or e-mail address').'</label></span></td></tr>';
+                      &mt('Either username or e-mail address').'</label></span></fieldset></td></tr>';
         $itemcount ++;
         $css_class = $itemcount%2?' class="LC_odd_row"':'';
         $datatable .= '<tr'.$css_class.'><td>'.$titles{'postlink'}.'</td>'.
@@ -8147,7 +8428,7 @@
                     $datatable .= '<span class="LC_nobreak"><label>'.
                                   '<input type="checkbox" name="passwords_postlink_'.$item.'" value="'.
                                   $field.'"'.$checked.' />'.$field.'</label>'.
-                                  '<span>   ';
+                                  '</span>   ';
                 }
                 $datatable .= '</fieldset>';
             }
@@ -8165,13 +8446,15 @@
             $datatable .= '<span class="LC_nobreak"><label>'.
                           '<input type="checkbox" name="passwords_postlink_default" value="'.
                           $field.'"'.$checked.' />'.$field.'</label>'.
-                          '<span>   ';
+                          '</span>   ';
         }
         $datatable .= '</fieldset></td></tr>';
         $itemcount ++;
         $css_class = $itemcount%2?' class="LC_odd_row"':'';
         $datatable .= '<tr'.$css_class.'><td>'.$titles{'emailsrc'}.'</td>'.
-                      '<td class="LC_left_item">';
+                      '<td class="LC_left_item">'.
+                      '<fieldset class="LC_borderless">'.
+                      '<legend class="LC_visually_hidden">'.$titles{'emailsrc'}.'</legend>';
         foreach my $type ('permanent','critical','notify') {
             my $checkedemail;
             if ($emailsrc{$type}) {
@@ -8180,9 +8463,9 @@
             $datatable .= '<span class="LC_nobreak"><label>'.
                           '<input type="checkbox" name="passwords_emailsrc" value="'.
                           $type.'"'.$checkedemail.' />'.$titles{$type}.'</label>'.
-                          '<span>   ';
+                          '</span>   ';
         }
-        $datatable .= '</td></tr>';
+        $datatable .= '</fieldset></td></tr>';
         $itemcount ++;
         $css_class = $itemcount%2?' class="LC_odd_row"':'';
         my $switchserver = &check_switchserver($dom,$confname);
@@ -8193,15 +8476,18 @@
             $showstd = ' checked="checked"';
         }
         $datatable .= '<tr'.$css_class.'><td>'.$titles{'customtext'}.'</td>'.
-                      '<td class="LC_left_item"><span class="LC_nobreak">'.
-                      &mt('Retain standard text:').
+                      '<td class="LC_left_item">'.
+                      '<span class="LC_nobreak" aria-hidden="true">'.&mt('Retain standard text').':</span>'.
+                      '<fieldset class="LC_borderless">'.
+                      '<legend class="LC_visually_hidden">'.&mt('Retain standard text').'</legend>'.
+                      '<span class="LC_nobreak">'.
                       '<label><input type="radio" name="passwords_stdtext" value="1"'.$showstd.' />'.
                       &mt('Yes').'</label>'.' '.
                       '<label><input type="radio" name="passwords_stdtext" value="0"'.$noshowstd.' />'.
-                      &mt('No').'</label></span><br />'.
-                      '<span class="LC_fontsize_small">'.
+                      &mt('No').'</label></span></fieldset><br />'.
+                      '<span class="LC_fontsize_medium">'.
                       &mt('(If you use the same account ...  reset a password from this page.)').'</span><br /><br />'.
-                      &mt('Include custom text:');
+                      '<label for="passwords_customfile">'.&mt('Include custom text:').'</label>';
         if ($customurl) {
             my $link =  &Apache::loncommon::modal_link($customurl,&mt('custom text'),600,500,
                                                        undef,undef,undef,undef,'background-color:#ffffff');
@@ -8214,7 +8500,8 @@
             $datatable .= '<span class="LC_nobreak"> '.&mt('Upload to library server: [_1]',$switchserver).'</span>';
         } else {
             $datatable .='<span class="LC_nobreak"> '.
-                         '<input type="file" name="passwords_customfile" /></span>';
+                         '<input type="file" name="passwords_customfile" id="passwords_customfile" />'.
+                         '</span>';
         }
         $datatable .= '</td></tr>';
     } elsif ($position eq 'middle') {
@@ -8246,8 +8533,13 @@
                 $css_class = ' class="LC_odd_row" ';
             }
             $datatable .= '<tr'.$css_class.'>'.
-                          '<td><span class="LC_nobreak">'.$titles{$item}.
-                          '</span></td><td class="LC_left_item" colspan="3">';
+                          '<td><span class="LC_nobreak">';
+            if ($item eq 'intauth_cost') {
+                $datatable .= '<label for="'.$item.'">'.$titles{$item}.'</label>';
+            } else {
+                $datatable .= $titles{$item};
+            }
+            $datatable .= '</span></td><td class="LC_left_item" colspan="3">';
             if ($item eq 'intauth_switch') {
                 my @options = (0,1,2);
                 my %optiondesc = &Apache::lonlocal::texthash (
@@ -8255,18 +8547,22 @@
                                    1 => 'Yes',
                                    2 => 'Yes, and copy existing passwd file to passwd.bak file',
                                  );
-                $datatable .= '<table width="100%">';
+                $datatable .= '<fieldset class="LC_borderless" style="line-height: 185%; width: 100%;">'.
+                              '<legend class="LC_visually_hidden">'.$titles{$item}.'</legend>';
                 foreach my $option (@options) {
                     my $checked = ' ';
                     if ($defaults{$item} eq $option) {
                         $checked = ' checked="checked"';
                     }
-                    $datatable .= '<tr><td class="LC_left_item"><span class="LC_nobreak">'.
+                    $datatable .= '<span class="LC_left_item LC_nobreak">'.
                                   '<label><input type="radio" name="'.$item.
                                   '" value="'.$option.'"'.$checked.' />'.
-                                  $optiondesc{$option}.'</label></span></td></tr>';
+                                  $optiondesc{$option}.'</label></span>';
+                    unless ($option eq $options[-1]) {
+                        $datatable .= '<br />'; 
+                    }
                 }
-                $datatable .= '</table>';
+                $datatable .= '</fieldset>';
             } elsif ($item eq 'intauth_check') {
                 my @options = (0,1,2);
                 my %optiondesc = &Apache::lonlocal::texthash (
@@ -8274,7 +8570,8 @@
                                    1 => 'Yes, allow login then update passwd file using default cost (if higher)',
                                    2 => 'Yes, disallow login if stored cost is less than domain default',
                                  );
-                $datatable .= '<table width="100%">';
+                $datatable .= '<fieldset class="LC_borderless" style="line-height: 185%; width: 100%;">'.
+                              '<legend class="LC_visually_hidden">'.$titles{$item}.'</legend>';
                 foreach my $option (@options) {
                     my $checked = ' ';
                     my $onclick;
@@ -8284,14 +8581,17 @@
                     if ($option == 2) {
                         $onclick = ' onclick="javascript:warnIntAuth(this);"';
                     }
-                    $datatable .= '<tr><td class="LC_left_item"><span class="LC_nobreak">'.
+                    $datatable .= '<span class="LC_left_item LC_nobreak">'.
                                   '<label><input type="radio" name="'.$item.
                                   '" value="'.$option.'"'.$checked.$onclick.' />'.
-                                  $optiondesc{$option}.'</label></span></td></tr>';
+                                  $optiondesc{$option}.'</label></span>';
+                    unless ($option eq $options[-1]) {
+                        $datatable .= '<br />';
+                    }
                 }
-                $datatable .= '</table>';
+                $datatable .= '</fieldset>';
             } else {
-                $datatable .= '<input type="text" name="'.$item.'" value="'.
+                $datatable .= '<input type="text" name="'.$item.'" id="'.$item.'" value="'.
                               $defaults{$item}.'" size="3" onblur="javascript:warnIntAuth(this);" />';
             }
             $datatable .= '</td></tr>';
@@ -8407,28 +8707,31 @@
                                                  spec => 'At least one non-alphanumeric',
                                                );
     my $css_class = $itemcount%2?' class="LC_odd_row"':'';
-    $datatable .= '<tr'.$css_class.'><td>'.$titles{'min'}.'</td>'.
+    $datatable .= '<tr'.$css_class.'><td><label for="'.$prefix.'_min">'.$titles{'min'}.'</label></td>'.
                   '<td class="LC_left_item"><span class="LC_nobreak">'.
-                  '<input type="text" name="'.$prefix.'_min" value="'.$min.'" size="3" '.
+                  '<input type="text" name="'.$prefix.'_min" id="'.$prefix.'_min" value="'.$min.'" size="3" '.
                   'onblur="javascript:warnInt'.$prefix.'(this);" />'.
-                  '<span class="LC_fontsize_small"> '.&mt('(Enter an integer: 7 or larger)').'</span>'.
+                  '<span class="LC_fontsize_medium"> '.&mt('(Enter an integer: 7 or larger)').'</span>'.
                   '</span></td></tr>';
     $itemcount ++;
     $css_class = $itemcount%2?' class="LC_odd_row"':'';
-    $datatable .= '<tr'.$css_class.'><td>'.$titles{'max'}.'</td>'.
+    $datatable .= '<tr'.$css_class.'><td><label for="'.$prefix.'_max">'.$titles{'max'}.'</label></td>'.
                   '<td class="LC_left_item"><span class="LC_nobreak">'.
-                  '<input type="text" name="'.$prefix.'_max" value="'.$max.'" size="3" '.
+                  '<input type="text" name="'.$prefix.'_max" id="'.$prefix.'_max" value="'.$max.'" size="3" '.
                   'onblur="javascript:warnInt'.$prefix.'(this);" />'.
-                  '<span class="LC_fontsize_small"> '.&mt('(Leave blank for no maximum)').'</span>'.
+                  '<span class="LC_fontsize_medium"> '.&mt('(Leave blank for no maximum)').'</span>'.
                   '</span></td></tr>';
     $itemcount ++;
     $css_class = $itemcount%2?' class="LC_odd_row"':'';
     $datatable .= '<tr'.$css_class.'><td>'.$titles{'chars'}.'<br />'.
-                  '<span class="LC_nobreak LC_fontsize_small">'.&mt('(Leave unchecked if not required)').
+                  '<span class="LC_nobreak LC_fontsize_medium">'.&mt('(Leave unchecked if not required)').
                   '</span></td>';
     my $numinrow = 2;
     my @possrules = ('uc','lc','num','spec');
-    $datatable .= '<td class="LC_left_item"><table>';
+    $datatable .= '<td class="LC_left_item">'.
+                  '<fieldset class="LC_borderless">'.
+                  '<legend class="LC_visually_hidden">'.$titles{'chars'}.'</legend>'.
+                  '<div class="LC_grid" role="grid">';
     for (my $i=0; $i<@possrules; $i++) {
         my ($rem,$checked);
         if ($chars{$possrules[$i]}) {
@@ -8437,41 +8740,34 @@
         $rem = $i%($numinrow);
         if ($rem == 0) {
             if ($i > 0) {
-                $datatable .= '</tr>';
+                $datatable .= '</div>';
             }
-            $datatable .= '<tr>';
+            $datatable .= '<div class="LC_grid_row" role="row">';
         }
-        $datatable .= '<td><span class="LC_nobreak"><label>'.
+        $datatable .= '<div class="LC_grid_cell" role="gridcell">'.
+                      '<span class="LC_nobreak"><label>'.
                       '<input type="checkbox" name="'.$prefix.'_chars" value="'.$possrules[$i].'"'.$checked.' />'.
-                      $rulenames{$possrules[$i]}.'</label></span></td>';
-    }
-    my $rem = @possrules%($numinrow);
-    my $colsleft = $numinrow - $rem;
-    if ($colsleft > 1 ) {
-        $datatable .= '<td colspan="'.$colsleft.'" class="LC_left_item">'.
-                      ' </td>';
-    } elsif ($colsleft == 1) {
-        $datatable .= '<td class="LC_left_item"> </td>';
+                      $rulenames{$possrules[$i]}.'</label></span></div>';
     }
-    $datatable .='</table></td></tr>';
+    $datatable .='</div></div></fieldset></td></tr>';
     $itemcount ++;
     if ($prefix eq 'passwords') {
         $titles{'expire'} = &mt('Password expiration (days)');
         $titles{'numsaved'} = &mt('Number of previous passwords to save and disallow reuse');
         $css_class = $itemcount%2?' class="LC_odd_row"':'';
-        $datatable .= '<tr'.$css_class.'><td>'.$titles{'expire'}.'</td>'.
+        $datatable .= '<tr'.$css_class.'><td><label for="'.$prefix.'_expire">'.$titles{'expire'}.'</label></td>'.
                       '<td class="LC_left_item"><span class="LC_nobreak">'.
-                      '<input type="text" name="'.$prefix.'_expire" value="'.$expire.'" size="4" '.
+                      '<input type="text" name="'.$prefix.'_expire" id="'.$prefix.'_expire" value="'.$expire.'" size="4" '.
                       'onblur="javascript:warnInt'.$prefix.'(this);" />'.
-                      '<span class="LC_fontsize_small"> '.&mt('(Leave blank for no expiration)').'</span>'.
+                      '<span class="LC_fontsize_medium"> '.&mt('(Leave blank for no expiration)').'</span>'.
                       '</span></td></tr>';
         $itemcount ++;
         $css_class = $itemcount%2?' class="LC_odd_row"':'';
-        $datatable .= '<tr'.$css_class.'><td>'.$titles{'numsaved'}.'</td>'.
+        $datatable .= '<tr'.$css_class.'><td><label for="'.$prefix.'_numsaved">'.$titles{'numsaved'}.'</label></td>'.
                       '<td class="LC_left_item"><span class="LC_nobreak">'.
-                      '<input type="text" name="'.$prefix.'_numsaved" value="'.$numsaved.'" size="3" '.
+                      '<input type="text" name="'.$prefix.'_numsaved" id="'.$prefix.'_numsaved" value="'.$numsaved.'" size="3" '.
                       'onblur="javascript:warnInt'.$prefix.'(this);" />'.
-                      '<span class="LC_fontsize_small"> '.&mt('(Leave blank to not save previous passwords)').'</span>'.
+                      '<span class="LC_fontsize_medium"> '.&mt('(Leave blank to not save previous passwords)').'</span>'.
                       '</span></td></tr>';
         $itemcount ++;
     }
@@ -8549,12 +8845,12 @@
         foreach my $server (sort(keys(%servers))) {
             $itemcount ++;
             my $dom_in_effect;
-            my $aliasrows = '<tr>'.
-                            '<td class="LC_left_item" style="vertical-align: baseline;">'.
+            my $aliasrows = '<div class="LC_grid_row" role="row">'.
+                            '<div class="LC_grid_cell" style="text-align: left; vertical-align: baseline;">'.
                             &mt('Hostname').': '.
                             '<span class="LC_nobreak LC_cusr_emph">'.
                             &Apache::lonnet::hostname($server).
-                            '</span></td><td> </td>';
+                            '</span></div>';
             if ($othercontrol{$server}) {
                 $dom_in_effect = $othercontrol{$server};
                 my ($current,$forsaml);
@@ -8566,7 +8862,7 @@
                         $forsaml = 1;
                     }
                 }
-                $aliasrows .= '<td class="LC_left_item" style="vertical-align: baseline;">'.
+                $aliasrows .= '<div class="LC_grid_cell" role="gridcell" style="text-align: left; vertical-align: baseline;">'.
                               &mt('Alias').':&nbsp';
                 if ($current) {
                     $aliasrows .= $current;
@@ -8578,7 +8874,7 @@
                 }
                 $aliasrows .= ' <span class="LC_small">('.
                               &mt('controlled by domain: [_1]',
-                                  '<b>'.$dom_in_effect.'</b>').')</span></td>';
+                                  '<b>'.$dom_in_effect.'</b>').')</span></div>';
             } else {
                 $dom_in_effect = $dom;
                 my ($current,$samlon,$samloff);
@@ -8594,42 +8890,47 @@
                         undef($samloff);
                     }
                 }
-                $aliasrows .= '<td class="LC_left_item" style="vertical-align: baseline;">'.
-                              &mt('Alias').': '.
+                $aliasrows .= '<div class="LC_grid_cell" role="gridcell" style="text-align: left; vertical-align: baseline; line-height: 200%;">'.
+                              '<label>'.&mt('Alias').': '.
                               '<input type="text" name="wafproxy_alias_'.$server.'" '.
-                              'value="'.$current.'" size="30" />'.
-                              (' 'x2).'<span class="LC_nobreak">'.
-                              &mt('Alias used for SSO Auth').': <label>'.
+                              'value="'.$current.'" size="30" /></label>'.
+                              (' 'x2).
+                              '<fieldset class="LC_borderless">'.
+                              '<legend class="LC_visually_hidden">'.&mt('Alias used for SSO Auth for hostname: [_1]',$server).'</legend>'.
+                              '<span class="LC_nobreak">'.
+                              '<span aria-hidden="true">'.&mt('Alias used for SSO Auth').': </span><label>'.
                               '<input type="radio" value="0"'.$samloff.' name="wafproxy_alias_saml_'.$server.'" />'.
                               &mt('No').'</label> <label>'.
                               '<input type="radio" value="1"'.$samlon.' name="wafproxy_alias_saml_'.$server.'" />'.
-                              &mt('Yes').'</label></span>'.
-                              '</td>';
+                              &mt('Yes').'</label></span></fieldset>'.
+                              '</div>';
             }
-            $aliasrows .= '</tr>';
+            $aliasrows .= '</div>';
             $aliasinfo{$dom_in_effect} .= $aliasrows;
         }
         if ($aliasinfo{$dom}) {
             my ($onclick,$wafon,$wafoff,$showtable);
             $onclick = ' onclick="javascript:toggleWAF();"';
             $wafoff = ' checked="checked"';
-            $showtable = ' style="display:none";';
+            $showtable = ' style="display: none;"';
             if ($showdom) {
                 $wafon = $wafoff;
                 $wafoff = '';
-                $showtable = ' style="display:inline;"';
+                $showtable = ' style="display: inline;"';
             }
             $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
             $datatable = '<tr'.$css_class.'>'.
                          '<td class="LC_left_item">'.&mt('Domain: [_1]','<b>'.$dom.'</b>').'<br />'.
+                         '<fieldset class="LC_borderless">'.
+                         '<legend class="LC_visually_hidden">'.&mt('WAF in use for domain: [_1]',$dom).'</legend>'.
                          '<span class="LC_nobreak">'.&mt('WAF in use?').' <label>'.
                          '<input type="radio" name="wafproxy_'.$dom.'" value="1"'.$wafon.$onclick.' />'.
                          &mt('Yes').'</label>'.(' 'x2).'<label>'.
                          '<input type="radio" name="wafproxy_'.$dom.'" value="0"'.$wafoff.$onclick.' />'.
-                         &mt('No').'</label></span></td>'.
+                         &mt('No').'</label></span></fieldset></td>'.
                          '<td class="LC_left_item">'.
-                         '<table id="wafproxy_table"'.$showtable.'>'.$aliasinfo{$dom}.
-                         '</table></td></tr>';
+                         '<div class="LC_grid" role="grid" id="wafproxy_table"'.$showtable.'>'.$aliasinfo{$dom}.
+                         '</div></td></tr>';
             $itemcount++;
         }
         if (keys(%otherdoms)) {
@@ -8649,22 +8950,22 @@
             $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
             my ($nowafstyle,$wafstyle,$curr_remotip,$currwafdisplay,$vpndircheck,$vpnaliascheck,
                 $currwafvpn,$wafrangestyle,$alltossl,$ssltossl);
-            $wafstyle = ' style="display:none;"';
+            $wafstyle = ' style="display: none;"';
             $nowafstyle = ' style="display:table-row;"';
-            $currwafdisplay = ' style="display: none"';
-            $wafrangestyle = ' style="display: none"';
+            $currwafdisplay = ' style="display: none;"';
+            $wafrangestyle = ' style="display: none;"';
             $curr_remotip = 'n';
             $ssltossl = ' checked="checked"';
             if ($showdom) {
-                $wafstyle = ' style="display:table-row;"';
-                $nowafstyle =  ' style="display:none;"';
+                $wafstyle = ' style="display: table-row;"';
+                $nowafstyle =  ' style="display: none;"';
                 if (keys(%{$values{$dom}})) {
                     if ($values{$dom}{remoteip} =~ /^[nmh]$/) {
                         $curr_remotip = $values{$dom}{remoteip};
                     }
                     if ($curr_remotip eq 'h') {
-                        $currwafdisplay = ' style="display:table-row"';
-                        $wafrangestyle = ' style="display:inline-block;"';
+                        $currwafdisplay = ' style="display: table-row;"';
+                        $wafrangestyle = ' style="display: inline-block;"';
                     }
                     if ($values{$dom}{'sslopt'}) {
                         $alltossl = ' checked="checked"';
@@ -8674,10 +8975,10 @@
                 if (($values{$dom}{'vpnint'} ne '') || ($values{$dom}{'vpnext'} ne '')) {
                     $vpndircheck = ' checked="checked"';
                     $currwafvpn = ' style="display:table-row;"';
-                    $wafrangestyle = ' style="display:inline-block;"';
+                    $wafrangestyle = ' style="display: inline-block;"';
                 } else {
                     $vpnaliascheck = ' checked="checked"';
-                    $currwafvpn = ' style="display:none;"';
+                    $currwafvpn = ' style="display: none;"';
                 }
             }
             $datatable .= '<tr'.$css_class.' id="nowafproxyrow_'.$dom.'"'.$wafstyle.'>'.
@@ -8689,9 +8990,11 @@
                           '<div id="wafproxyranges_'.$dom.'">'.&mt('Format for comma separated IP ranges').':<br />'.
                           &mt('A.B.C.D/N or A.B.C.D-E.F.G.H').'<br />'.
                           &mt('Range(s) stored in CIDR notation').'</div></td>'.
-                          '<td class="LC_left_item"><table>'.
-                          '<tr>'.
-                          '<td valign="top">'.$lt{'remoteip'}.': '.
+                          '<td class="LC_left_item">'.
+                          '<div class="LC_grid" role="grid">'.
+                          '<div class="LC_grid_row" role="row">'.
+                          '<div class="LC_grid_cell" role="gridcell">'.
+                          '<label for="wafproxy_remoteip">'.$lt{'remoteip'}.'</label>: '.
                           '<select name="wafproxy_remoteip" id="wafproxy_remoteip" onchange="javascript:updateWAF();">';
             foreach my $option ('m','h','n') {
                 my $sel;
@@ -8701,39 +9004,51 @@
                 $datatable .= '<option value="'.$option.'"'.$sel.'>'.
                               $ip_methods{$option}.'</option>';
             }
-            $datatable .= '</select></td></tr>'."\n".
-                          '<tr id="wafproxy_header"'.$currwafdisplay.'><td>'.
-                          $lt{'ipheader'}.': '.
+            $datatable .= '</select></div></div>'."\n".
+                          '<div id="wafproxy_header" class="LC_grid_row" role="row"'.$currwafdisplay.'>'. 
+                          '<div class="LC_grid_cell" role="gridcell">'.
+                          '<label>'.$lt{'ipheader'}.': '.
                           '<input type="text" value="'.$values{$dom}{'ipheader'}.'" '.
-                          'name="wafproxy_ipheader" />'.
-                          '</td></tr>'."\n".
-                          '<tr id="wafproxy_trust"'.$currwafdisplay.'><td>'.
-                          $lt{'trusted'}.':<br />'.
+                          'name="wafproxy_ipheader" /></label>'.
+                          '</div></div>'."\n".
+                          '<div id="wafproxy_trust" class="LC_grid_row" role="row"'.$currwafdisplay.'>'. 
+                          '<div class="LC_grid_cell" role="gridcell">'.
+                          '<label>'.$lt{'trusted'}.':<br />'.
                           '<textarea name="wafproxy_trusted" rows="3" cols="80">'.
-                          $values{$dom}{'trusted'}.'</textarea>'.
-                          '</td></tr>'."\n".
-                          '<tr><td><hr /></td></tr>'."\n".
-                          '<tr>'.
-                          '<td valign="top">'.$lt{'vpnaccess'}.':<br /><span class="LC_nobreak">'.
+                          $values{$dom}{'trusted'}.'</textarea></label>'.
+                          '</div></div>'."\n".
+                          '<div class="LC_grid_row" role="row">'.
+                          '<div class="LC_grid_cell" role="gridcell">'.
+                          '<hr /></div></div>'."\n".
+                          '<div class="LC_grid_row" role="row">'.
+                          '<div class="LC_grid_cell" role="gridcell">'.$lt{'vpnaccess'}.':<br />'.
+                          '<fieldset class="LC_borderless">'.
+                          '<legend class="LC_visually_hidden">'.$lt{'vpnaccess'}.'</legend>'.
+                          '<span class="LC_nobreak">'.
                           '<label><input type="radio" name="wafproxy_vpnaccess"'.$vpndircheck.' value="1" onclick="javascript:checkWAF();" />'.
                           $lt{'vpndirect'}.'</label>'.(' 'x2).
                           '<label><input type="radio" name="wafproxy_vpnaccess"'.$vpnaliascheck.' value="0" onclick="javascript:checkWAF();" />'.
-                          $lt{'vpnaliased'}.'</label></span></td></tr>';
+                          $lt{'vpnaliased'}.'</label></span></fieldset></div></div>';
             foreach my $item ('vpnint','vpnext') {
-                $datatable .= '<tr id="wafproxy_show_'.$item.'"'.$currwafvpn.'>'.
-                              '<td valign="top">'.$lt{$item}.':<br />'.
+                $datatable .= '<div id="wafproxy_show_'.$item.'" class="LC_grid_row" role="row"'.$currwafvpn.'>'.
+                              '<div class="LC_grid_cell" role="gridcell"><label>'.$lt{$item}.':<br />'.
                               '<textarea name="wafproxy_'.$item.'" rows="3" cols="80">'.
-                              $values{$dom}{$item}.'</textarea>'.
-                              '</td></tr>'."\n";
+                              $values{$dom}{$item}.'</textarea></label>'.
+                              '</div></div>'."\n";
             }
-            $datatable .= '<tr><td><hr /></td></tr>'."\n".
-                          '<tr>'.
-                          '<td valign="top">'.$lt{'sslopt'}.':<br /><span class="LC_nobreak">'.
+            $datatable.=  '<div class="LC_grid_row" role="row">'.
+                          '<div class="LC_grid_cell" role="gridcell">'.
+                          '<hr /></div></div>'."\n".
+                          '<div class="LC_grid_row" role="row">'.
+                          '<div class="LC_grid_cell" role="gridcell">'.$lt{'sslopt'}.':<br />'.
+                          '<fieldset class="LC_borderless">'.
+                          '<legend class="LC_visually_hidden">'.$lt{'sslopt'}.'</legend>'.
+                          '<span class="LC_nobreak">'.
                           '<label><input type="radio" name="wafproxy_sslopt"'.$alltossl.' value="1" />'.
                           $lt{'alltossl'}.'</label>'.(' 'x2).
                           '<label><input type="radio" name="wafproxy_sslopt"'.$ssltossl.' value="0" />'.
-                          $lt{'ssltossl'}.'</label></span></td></tr>'."\n".
-                          '</table></td></tr>';
+                          $lt{'ssltossl'}.'</label></span></fieldset></div></div>'."\n".
+                          '</div></td></tr>';
         }
         if (keys(%otherdoms)) {
             foreach my $domain (sort(keys(%otherdoms))) {
@@ -8874,13 +9189,15 @@
             next if ($type ne 'version' && !@locations);
             $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
             $datatable .= '<tr'.$css_class.'>
-                           <td><span class="LC_nobreak">'.$titles->{$type}.'</span><br />
+                           <td><span class="LC_nobreak" aria-hidden="true">'.$titles->{$type}.'</span><br />
+                           <fieldset class="LC_borderless">
+                           <legend class="LC_visually_hidden">'.$titles->{$type}.'</legend>
                            <span class="LC_nobreak"> 
                            <label><input type="radio" name="'.$prefix.'_'.$type.'_inuse" '.$checkedoff{$type}.' value="0" />'.&mt('Not in use').'</label> 
-                           <label><input type="radio" name="'.$prefix.'_'.$type.'_inuse" '.$checkedon{$type}.' value="1" />'.&mt('In use').'</label></span></td><td>';
+                           <label><input type="radio" name="'.$prefix.'_'.$type.'_inuse" '.$checkedon{$type}.' value="1" />'.&mt('In use').'</label></span></fieldset></td><td>';
             if ($type eq 'version') {
                 my @lcversions = &Apache::lonnet::all_loncaparevs();
-                my $selector = '<select name="'.$prefix.'_version">';
+                my $selector = '<select name="'.$prefix.'_version" aria-label="'.&mt('Set version requirement').'">';
                 foreach my $version (@lcversions) {
                     my $selected = '';
                     if ($current{'version'} eq $version) {
@@ -8892,13 +9209,15 @@
                 $selector .= '</select> ';
                 $datatable .= &mt('remote server must be version: [_1] or later',$selector);
             } else {
-                $datatable.= '<div><input type="button" value="'.&mt('check all').'" '.
+                $datatable.= '<fieldset>'.
+                             '<legend><input type="button" value="'.&mt('check all').'" '.
                              'onclick="javascript:checkAll(document.display.'.$prefix.'_'.$type.')"'.
                              ' />'.(' 'x2).
                              '<input type="button" value="'.&mt('uncheck all').'" '.
                              'onclick="javascript:uncheckAll(document.display.'.$prefix.'_'.$type.')" />'.
                              "\n".
-                             '</div><div><table>';
+                             '</legend>'."\n".
+                             '<div class="LC_grid" role="grid">';
                 my $rem;
                 for (my $i=0; $i<@locations; $i++) {
                     my ($showloc,$value,$checkedtype);
@@ -8920,25 +9239,17 @@
                     $rem = $i%($numinrow);
                     if ($rem == 0) {
                         if ($i > 0) {
-                            $datatable .= '</tr>';
+                            $datatable .= '</div>';
                         }
-                        $datatable .= '<tr>';
+                        $datatable .= '<div class="LC_grid_row" role="row">';
                     }
-                    $datatable .= '<td class="LC_left_item">'.
+                    $datatable .= '<div class="LC_grid_cell" role="gridcell">'.
                                   '<span class="LC_nobreak"><label>'.
                                   '<input type="checkbox" name="'.$prefix.'_'.$type.
                                   '" value="'.$value.'"'.$checkedtype.' />'.$showloc.
-                                  '</label></span></td>';
-                }
-                $rem = @locations%($numinrow);
-                my $colsleft = $numinrow - $rem;
-                if ($colsleft > 1 ) {
-                    $datatable .= '<td colspan="'.$colsleft.'" class="LC_left_item">'.
-                                  ' </td>';
-                } elsif ($colsleft == 1) {
-                    $datatable .= '<td class="LC_left_item"> </td>';
+                                  '</label></span></div>';
                 }
-                $datatable .= '</tr></table>';
+                $datatable .= '</div></div></fieldset>';
             }
             $datatable .= '</td></tr>';
             $itemcount ++;
@@ -8976,6 +9287,10 @@
     } else {
         my %titles = &ssl_titles();
         my (%by_ip,%by_location, at intdoms, at instdoms);
+        @intdoms = ();
+        @instdoms = ();
+        %by_ip = ();
+        %by_location = ();
         &build_location_hashes(\@intdoms,\%by_ip,\%by_location,\@instdoms);
         my @alldoms = &Apache::lonnet::all_domains();
         my %serverhomes = %Apache::lonnet::serverhomeIDs;
@@ -9033,6 +9348,8 @@
                 }
                 unless ($skip) {
                     $checked{'yes'} = ' checked="checked"'; 
+                    $datatable .= '<fieldset class="LC_borderless" style="line-height: 170%;">'.
+                                  '<legend class="LC_visually_hidden">'.$titles{$type}.'</legend>';  
                     if (ref($settings) eq 'HASH') {
                         if (ref($settings->{$position}) eq 'HASH') {
                             if ($settings->{$position}->{$type} =~ /^(no|req)$/) {
@@ -9052,6 +9369,7 @@
                                       'value="'.$option.'"'.$checked{$option}.' />'.$titles{$option}.
                                       '</label></span>'.(' 'x2);
                     }
+                    $datatable .= '</fieldset>';
                 }
                 $datatable .= '</td></tr>';
                 $itemcount ++; 
@@ -9293,9 +9611,11 @@
             $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
             $datatable .= '<tr'.$css_class.'>
                            <td rowspan="2">
-                            <span class="LC_nobreak">'.
+                           <span class="LC_nobreak">'.
                           &mt('[_1] when busy, offloads to:'
-                              ,'<b>'.$server.'</b>').'</span><br />'.
+                              ,'<b>'.$server.'</b>').'</span>'.
+                          '<fieldset class="LC_borderless" style="display: block; line-height: 185%;">'.
+                          '<legend class="LC_visually_hidden">'.&mt('users offloaded if busy?').'</legend>'.
                           '<span class="LC_nobreak">'."\n".
                           '<label><input type="checkbox" name="offloadnow" value="'.$server.'"'.$checkednow.' />'.
                           ' '.&mt('Switch any active user on next access').'</label></span>'.
@@ -9307,6 +9627,7 @@
                           ' '.&mt('Switch other institutions on next access').'</label></span>'.
                           "\n";
             }
+            $datatable .= '</fieldset></td>';
             my (%current,%canselect);
             my @choices = 
                 &possible_newspares($server,$spareid->{$server},$serverhomes,$altids);
@@ -9318,43 +9639,36 @@
                             if ($othercontrol) {
                                 $current{$type} = join(', ', at spares);
                             } else {
-                                $current{$type} .= '<table>';
+                                $current{$type} .= '<div class="LC_grid" role="grid" style="margin: 0 2px 0 2px;">';
                                 my $numspares = scalar(@spares);
                                 for (my $i=0;  $i<@spares; $i++) {
                                     my $rem = $i%($numinrow);
                                     if ($rem == 0) {
                                         if ($i > 0) {
-                                            $current{$type} .= '</tr>';
+                                            $current{$type} .= '</div>';
                                         }
-                                        $current{$type} .= '<tr>';
+                                        $current{$type} .= '<div class="LC_grid_row" role="row">';
                                     }
-                                    $current{$type} .= '<td><label><input type="checkbox" name="spare_'.$type.'_'.$server.'" id="spare_'.$type.'_'.$server.'_'.$i.'" checked="checked" value="'.$spareid->{$server}{$type}[$i].'" onclick="updateNewSpares(this.form,'."'$server'".');" /> '.
+                                    $current{$type} .= '<div class="LC_grid_cell" role="gridcell">'.
+                                                       '<label><input type="checkbox" name="spare_'.$type.'_'.$server.'" id="spare_'.$type.'_'.$server.'_'.$i.'" checked="checked" value="'.$spareid->{$server}{$type}[$i].'" onclick="updateNewSpares(this.form,'."'$server'".');" /> '.
                                                        $spareid->{$server}{$type}[$i].
-                                                       '</label></td>'."\n";
-                                }
-                                my $rem = @spares%($numinrow);
-                                my $colsleft = $numinrow - $rem;
-                                if ($colsleft > 1 ) {
-                                    $current{$type} .= '<td colspan="'.$colsleft.
-                                                       '" class="LC_left_item">'.
-                                                       ' </td>';
-                                } elsif ($colsleft == 1) {
-                                    $current{$type} .= '<td class="LC_left_item"> </td>'."\n";
+                                                       '</label></div>'."\n";
                                 }
-                                $current{$type} .= '</tr></table>';
+                                $current{$type} .= '</div></div>';
                             }
                         }
                     }
                     if ($current{$type} eq '') {
-                        $current{$type} = &mt('None specified');
+                        $current{$type} = ' '.&mt('None specified');
                     }
                     if ($othercontrol) {
                         if ($type eq 'primary') {
                             $canselect{$type} = $othercontrol;
                         }
                     } else {
-                        $canselect{$type} = 
-                            &mt('Add new [_1]'.$type.'[_2]:','<i>','</i>').' '.
+                        $canselect{$type} =
+                            '<label for="newspare_'.$type.'_'.$server.'">'.
+                            &mt('Add new [_1]'.$type.'[_2]:','<i>','</i>').'</label> '.
                             '<select name="newspare_'.$type.'_'.$server.'" '.
                             'id="newspare_'.$type.'_'.$server.'" onchange="checkNewSpares('."'$server','$type'".');">'."\n".
                             '<option value="" selected ="selected">'.&mt('Select').'</option>'."\n";
@@ -9732,7 +10046,7 @@
     }
     my $space;
     if ($islast && $num == 1) {
-        $space = '<div style="display:inline-block;"> </div>';
+        $space = '<div style="display: inline-block;"> </div>';
     }
     my $output =
         '<tr class="'.$css_class.'" id="balanceruletr_'.$balnum.'_'.$num.'"><td style="vertical-align: top">'.$space.
@@ -9979,7 +10293,9 @@
             }
             $datatable .= '<tr'.$css_class.'>'.
                          '<td><span class="LC_nobreak">'.$lt{$item}.
-                         '</span></td><td style="text-align: right">';
+                         '</span></td><td style="text-align: right">'.
+                         '<fieldset class="LC_borderless" style="line-height: 175%;">'.
+                         '<legend class="LC_visually_hidden">'.$lt{$item}.'</legend>';
             my @options = ('any');
             if (ref($rules) eq 'HASH') {
                 if (keys(%{$rules}) > 0) {
@@ -9998,7 +10314,7 @@
                               $item.'" value="'.$option.'"'.$check.'/> '.
                               $lt{$option}.'</label>  </span>';
             }
-            $datatable .= '</td></tr>';
+            $datatable .= '</fieldset></td></tr>';
         }
     } else {
         my @contexts = ('author','course','domain');
@@ -10036,6 +10352,8 @@
             $datatable .=   '<tr'.$css_class.'>'.
                             '<td>'.$title{$item}.
                             '</td><td class="LC_left_item">'.
+                            '<fieldset class="LC_borderless" style="line-height: 175%;">'.
+                            '<legend class="LC_visually_hidden">'.$title{$item}.'</legend>'.
                             '<span class="LC_nobreak">';
             foreach my $auth (@authtypes) {
                 $datatable .= '<label>'. 
@@ -10043,7 +10361,7 @@
                               $checked{$item}{$auth}.' value="'.$auth.'" />'.
                               $authname{$auth}.'</label> ';
             }
-            $datatable .= '</span></td></tr>';
+            $datatable .= '</span></fieldset></td></tr>';
             $rownum ++;
         }
         $$rowtotal += $rownum;
@@ -10116,17 +10434,20 @@
         my $rem;
         my $numperrow = 2;
         my $css_class = $$rowtotal%2?' class="LC_odd_row"':'';
+        my $title = &mt('Mapping of Shibboleth environment variable names to user data fields (SSO auth)');
         $datatable .= '<tr'.$css_class.'>'.
-                     '<td class="LC_left_item">'.&mt('Mapping of Shibboleth environment variable names to user data fields (SSO auth)').'</td>'.
+                     '<td class="LC_left_item">'.$title.'</td>'.
                      '<td class="LC_left_item">'."\n".
-                     '<table>'."\n";
+                     '<fieldset class="LC_borderless">'.
+                     '<legend class="LC_visually_hidden">'.$title.'</legend>'.
+                     '<div class="LC_grid" role="grid">'."\n";
         for (my $i=0; $i<@fields; $i++) {
             $rem = $i%($numperrow);
             if ($rem == 0) {
                 if ($i > 0) {
-                    $datatable .= '</tr>';
+                    $datatable .= '</div>';
                 }
-                $datatable .= '<tr>';
+                $datatable .= '<div class="LC_grid_row" role="row">';
             }
             my $currval;
             if (ref($createsettings) eq 'HASH') {
@@ -10134,20 +10455,13 @@
                     $currval = $createsettings->{'shibenv'}{$fields[$i]};
                 }
             }
-            $datatable .= '<td class="LC_left_item">'.
-                          '<span class="LC_nobreak">'.
+            $datatable .= '<div class="LC_grid_cell" role="gridcell">'.
+                          '<span class="LC_nobreak"><label>'.
                           '<input type="text" name="shibenv_'.$fields[$i].'" '.
                           'value="'.$currval.'" size="10" /> '.
-                          $fieldtitles{$fields[$i]}.'</span></td>';
-        }
-        my $colsleft = $numperrow - $rem;
-        if ($colsleft > 1 ) {
-            $datatable .= '<td colspan="'.$colsleft.'" class="LC_left_item">'.
-                         ' </td>';
-        } elsif ($colsleft == 1) {
-            $datatable .= '<td class="LC_left_item"> </td>';
+                          $fieldtitles{$fields[$i]}.'</label></span></div>';
         }
-        $datatable .= '</tr></table></td></tr>';
+        $datatable .= '</div></div></fieldset></td></tr>';
         $$rowtotal ++;
     } elsif ($position eq 'middle') {
         my %domconf = &Apache::lonnet::get_dom('configuration',['usermodification'],$dom);
@@ -10180,7 +10494,7 @@
         my $classprefix = 'LC_canmodify_emailusername_';
         my $optionsprefix = 'LC_options_emailusername_';
         my $display = 'none';
-        my $rowstyle = 'display:none';
+        my $rowstyle = 'display: none;';
         if (grep(/^\Qemail\E$/, at selfcreate)) {
             $display = 'block';
             $rowstyle = 'display:table-row';
@@ -10235,7 +10549,7 @@
                 $css_class .= $customclass;
                 my $rowid = $optionsprefix.$status;
                 my $hidden = 1;
-                my $currstyle = 'display:none';
+                my $currstyle = 'display: none;';
                 if (grep(/^\Q$status\E$/, at ordered)) {
                     $currstyle = $rowstyle;
                     $hidden = 0;
@@ -10264,14 +10578,14 @@
         if (@posstypes) {
             foreach my $status (@posstypes) {
                 my $rowid = $classprefix.$status;
-                my $datarowstyle = 'display:none';
+                my $datarowstyle = 'display: none;';
                 if (grep(/^\Q$status\E$/, at ordered)) {
                     $datarowstyle = $rowstyle;
                 }
                 $datatable .= &modifiable_userdata_row('cancreate','emailusername_'.$status,$settings,
                                                        $numinrow,$$rowtotal,\%usertypeshash,$infofields,
                                                        $infotitles,$rowid,$customclass,$datarowstyle);
-                unless ($datarowstyle eq 'display:none') {
+                unless ($datarowstyle eq 'display: none;') {
                     $$rowtotal ++;
                 }
             }
@@ -10402,7 +10716,7 @@
     if ($rowstyle) {
         $rowstyle = ' style="'.$rowstyle.'"';
     }
-    my ($output,$description);
+    my ($output,$description,$showcustom,$customchecked);
     if ($type eq 'default') {
         $description = &mt('Requests for: [_1]',$typetitle);
     } else {
@@ -10441,7 +10755,6 @@
                                                      custom  => 'Custom restrictions',
                                                    );
             @options = ('any','inst','noninst');
-            my $showcustom;
             if (ref($emailrules) eq 'HASH') {
                 if (keys(%{$emailrules}) > 0) {
                     push(@options,'custom');
@@ -10481,6 +10794,9 @@
             $defoption = 'all';
             $name = 'cancreate_usernameoptions_'.$type;
         }
+        $output .= '<fieldset class="LC_borderless" style="line-height: 185%;">'.
+                   '<legend class="LC_visually_hidden">'.
+                   &mt('Options for [_1]',$headers{$item}.' -- '.$description).'</legend>';
         foreach my $option (@options) {
             my $checked;
             if (ref($hashref) eq 'HASH') {
@@ -10508,6 +10824,7 @@
             } elsif (($item eq 'email') && ($hascustom)) {
                 if ($option eq 'custom') {
                     $checked = ' checked="checked"';
+                    $customchecked = $checked;
                 }
             } elsif ($option eq $defoption) {
                 $checked = ' checked="checked"';
@@ -10517,19 +10834,7 @@
                        $checked.' value="'.$option.'"'.$onclick.' />'.
                        $choices{$option}.'</label></span><br />';
             if ($item eq 'email') {
-                if ($option eq 'custom') {
-                    my $id = 'cancreate_emailrule_'.$type;
-                    my $display = 'none';
-                    if ($checked) {
-                        $display = 'inline';
-                    }
-                    my $numinrow = 2;
-                    $output .= '<fieldset id="'.$id.'" style="display:'.$display.';">'.
-                               '<legend>'.&mt('Disallow').'</legend><table>'.
-                               &user_formats_row('email',$settings,$emailrules,
-                                                 $emailruleorder,$numinrow,'',$type);
-                              '</table></fieldset>';
-                } elsif (($option eq 'inst') || ($option eq 'noninst')) {
+                if (($option eq 'inst') || ($option eq 'noninst')) {
                     my %text = &Apache::lonlocal::texthash (
                                                              inst    => 'must end:',
                                                              noninst => 'cannot end:',
@@ -10549,12 +10854,28 @@
                         $display = 'inline';
                     }
                     $output .= '<div id="'.$condition.'" style="display:'.$display.';">'.
-                               '<span class="LC_domprefs_email">'.$text{$option}.'</span> '.
-                               '<input type="text" name="'.$condition.'" value="'.$value.'" size="10" />'.
+                               '<span class="LC_domprefs_email"><label for="'.$condition.'_text">'.
+                               $text{$option}.'</label></span> '.
+                               '<input type="text" name="'.$condition.'" id="'.$condition.'_text" value="'.$value.'" size="10" />'.
                                '</div>';
                 }
             }
         }
+        $output .= '</fieldset>';      
+        if (($item eq 'email') && ($showcustom)) {
+           my $id = 'cancreate_emailrule_'.$type;
+           my $display = 'none';
+           if ($customchecked) {
+               $display = 'inline';
+           }
+           my $numinrow = 2;
+           $output .= '<fieldset id="'.$id.'" style="display:'.$display.';">'.
+                      '<legend>'.&mt('Disallow').'</legend>'.
+                      '<div class="LC_grid" role="grid">'.
+                      &user_formats_row('email',$settings,$emailrules,
+                                        $emailruleorder,$numinrow,'',$type).
+                      '</div></fieldset>';
+        }
         $output .= '</td>'."\n";
     }
     $output .= "</tr></table></td></tr>\n";
@@ -10629,7 +10950,10 @@
     }
     my $output = '<tr'.$css_class.'>'.
                  '<td class="LC_left_item">'.$rowname.'</td><td class="LC_left_item" colspan="'.$colspan.'">'."\n".
-                 '<table><tr><td><fieldset class="LC_captcha"><legend>'.$lt{'captcha'}.'</legend>'."\n";
+                 '<div class="LC_grid" role="grid">'.
+                 '<div class="LC_grid_row" role="row">'.
+                 '<div class="LC_grid_cell" role="gridcell">'."\n".
+                 '<fieldset class="LC_captcha"><legend>'.$lt{'captcha'}.'</legend>'."\n";
     foreach my $option ('original','successor','notused') {
         $output .= '<span class="LC_nobreak"><label><input type="radio" name="'.$context.'_captcha" value="'.
                    $option.'" '.$checked{$option}.' onchange="javascript:updateCaptcha('."'captcha','$context',this.form".');" />'.
@@ -10650,8 +10974,9 @@
 # new site at https://dashboard.hcaptcha.com/, and if Turnstile is to be used a site key and secret key
 # will need to be created by visiting https://dash.cloudflare.com and adding a new Turnstile widget.
 #
-    $output .= '</fieldset></td></tr>'."\n".
-               '<tr><td class="LC_zero_height">'."\n".
+    $output .= '</fieldset></div></div>'."\n".
+               '<div class="LC_grid_row" role="row">'.
+               '<div class="LC_grid_cell" role="gridcell" style="line-height: 0;">'."\n".
                '<fieldset class="LC_captcha" id="'.$context.'_recaptchatype" style="display:'.$dispprov.'">'.
                '<legend>'.$lt{'type'}.'</legend>'."\n";
     foreach my $type ('recaptcha','hcaptcha','turnstile') {
@@ -10677,14 +11002,15 @@
                ' <input id="'.$context.'_recaptchathresh" type="'.$threshentry.'" size="3"'.
                ' name="'.$context.'_captchathreshold" value="'.$threshold.'" /></span></span>'."\n".
                '</fieldset><br />'.
-               '<fieldset class="LC_captcha" id="'.$context.'_recaptchakeys" style="display:'.$dispkeys.'"><legend>'.$lt{'keys'}.'</legend>'."\n".
-               '<span class="LC_nobreak">'.$lt{'pub'}.': '.
+               '<fieldset class="LC_captcha" id="'.$context.'_recaptchakeys" style="display:'.$dispkeys.'; line-height: 180%;"><legend>'.$lt{'keys'}.'</legend>'."\n".
+               '<span class="LC_nobreak"><label>'.$lt{'pub'}.': '.
                '<input type="text" name="'.$context.'_recaptchapub" value="'.$currpub.'" size="40" />'.
-               '</span><br />'."\n".
-               '<span class="LC_nobreak">'.$lt{'priv'}.': '.
-               '<input type="text" name="'.$context.'_recaptchapriv" value="'.$currpriv.'" size="40" /></span>'."\n".
+               '</label></span><br />'."\n".
+               '<span class="LC_nobreak"><label>'.$lt{'priv'}.': '.
+               '<input type="text" name="'.$context.'_recaptchapriv" value="'.$currpriv.'" size="40" />'.
+               '</label></span>'."\n".
                '</fieldset><br />'."\n".
-               '</td></tr></table>'."\n".
+               '</div></div></div>'."\n".
                '</td></tr>';
     return $output;
 }
@@ -10701,7 +11027,8 @@
         $output = '<tr '.$css_class.'>'.
                   '<td><span class="LC_nobreak">'.
                   &mt("Format rules to check for $text{$type}: ").
-                  '</td><td class="LC_left_item" colspan="2"><table>';
+                  '</td><td class="LC_left_item" colspan="2">'.
+                  '<div class="LC_grid" role="grid">';
     }
     my $rem;
     if (ref($ruleorder) eq 'ARRAY') {
@@ -10710,9 +11037,9 @@
                 my $rem = $i%($numinrow);
                 if ($rem == 0) {
                     if ($i > 0) {
-                        $output .= '</tr>';
+                        $output .= '</div>';
                     }
-                    $output .= '<tr>';
+                    $output .= '<div class="LC_grid_row" role="row">';
                 }
                 my $check = ' ';
                 if (ref($settings) eq 'HASH') {
@@ -10732,28 +11059,18 @@
                 if ($type eq 'email') {
                     $name .= '_'.$status;
                 }
-                $output .= '<td class="LC_left_item">'.
+                $output .= '<div class="LC_grid_cell" role="gridcell">'.
                            '<span class="LC_nobreak"><label>'.
                            '<input type="checkbox" name="'.$name.'" '.
                            'value="'.$ruleorder->[$i].'"'.$check.'/>'.
-                           $rules->{$ruleorder->[$i]}{'name'}.'</label></span></td>';
+                           $rules->{$ruleorder->[$i]}{'name'}.'</label></span></div>';
             }
         }
         $rem = @{$ruleorder}%($numinrow);
     }
-    my $colsleft;
-    if ($rem) {
-        $colsleft = $numinrow - $rem;
-    }
-    if ($colsleft > 1 ) {
-        $output .= '<td colspan="'.$colsleft.'" class="LC_left_item">'.
-                   ' </td>';
-    } elsif ($colsleft == 1) {
-        $output .= '<td class="LC_left_item"> </td>';
-    }
-    $output .= '</tr>';
+    $output .= '</div>';
     unless (($type eq 'email') || ($type eq 'unamemap')) {
-        $output .= '</table></td></tr>';
+        $output .= '</div></td></tr>';
     }
     return $output;
 }
@@ -10864,9 +11181,17 @@
                 $css_class = ' class="LC_odd_row" ';
             }
             $datatable .= '<tr'.$css_class.'>'.
-                          '<td><span class="LC_nobreak">'.$titles->{$item}.
-                          '</span></td><td class="LC_right_item" colspan="3">';
+                          '<td><span class="LC_nobreak">';
+            if (($item eq 'auth_arg_def') || ($item eq 'portal_def') ||
+                ($item eq 'datelocale_def') || ($item eq 'lang_def')) {
+                $datatable .= '<label for="'.$item.'">'.$titles->{$item}.'</label>';
+            } else {
+                $datatable .= $titles->{$item};
+            }
+            $datatable .= '</span></td><td class="LC_right_item" colspan="3">';
             if ($item eq 'auth_def') {
+                $datatable .= '<fieldset class="LC_borderless" style="line-height: 170%;">'.
+                              '<legend class="LC_visually_hidden">'.$titles->{$item}.'</legend>';
                 my @authtypes = ('internal','krb4','krb5','localauth','lti');
                 my %shortauth = (
                                  internal => 'int',
@@ -10885,18 +11210,20 @@
                                   '" value="'.$auth.'"'.$checked.'/>'.
                                   $authnames{$shortauth{$auth}}.'</label>  ';
                 }
+                $datatable .= '</fieldset>';
             } elsif ($item eq 'timezone_def') {
                 my $includeempty = 1;
                 $datatable .= &Apache::loncommon::select_timezone($item,$defaults{$item},undef,$includeempty);
             } elsif ($item eq 'datelocale_def') {
                 my $includeempty = 1;
-                $datatable .= &Apache::loncommon::select_datelocale($item,$defaults{$item},undef,$includeempty);
+                $datatable .= &Apache::loncommon::select_datelocale($item,$defaults{$item},undef,$includeempty,'',$item);
             } elsif ($item eq 'lang_def') {
                 my $includeempty = 1;
-                $datatable .= &Apache::loncommon::select_language($item,$defaults{$item},$includeempty);
+                $datatable .= &Apache::loncommon::select_language($item,$defaults{$item},$includeempty,'',$item);
             } elsif ($item eq 'portal_def') {
-                $datatable .= '<input type="text" name="'.$item.'" value="'.
-                              $defaults{$item}.'" size="25" onkeyup="portalExtras(this);" />';
+                $datatable .= '<div style="margin: 0 0 4px 0; padding: 0;">'.
+                              '<input type="text" name="'.$item.'" id="'.$item.'" value="'.
+                              $defaults{$item}.'" size="25" onkeyup="portalExtras(this);" /></div>';
                 my $portalsty = 'none';
                 if ($defaults{$item}) {
                     $portalsty = 'block';
@@ -10908,32 +11235,35 @@
                         $checkedon = $checkedoff;
                         $checkedoff = '';
                     }
-                    $datatable .= '<div id="'.$item.'_'.$field.'_div" style="display:'.$portalsty.'">'.
-                              '<span class="LC_nobreak">'.$titles->{$field}.' '.
+                    $datatable .= '<fieldset class="LC_borderless" id="'.$item.'_'.$field.'_div" style="display:'.$portalsty.'; line-height: 185%;">'.
+                              '<legend class="LC_visually_hidden">'.$titles->{$field}.'</legend>'.
+                              '<span class="LC_nobreak"><span aria-hidden="true">'.$titles->{$field}.' </span>'.
                               '<label><input type="radio" name="'.$item.'_'.$field.'" value="1"'.$checkedon.'/>'.&mt('Yes').'</label>'.
                               (' 'x2).
                               '<label><input type="radio" name="'.$item.'_'.$field.'" value="0"'.$checkedoff.'/>'.&mt('No').'</label>'.
-                              '</div>';
+                              '</span></fieldset>';
                 }
             } else {
-                $datatable .= '<input type="text" name="'.$item.'" value="'.$defaults{$item}.'" />';
+                $datatable .= '<input type="text" name="'.$item.'" id="'.$item.'" value="'.$defaults{$item}.'" />';
             }
             $datatable .= '</td></tr>';
             $rownum ++;
         }
     } elsif ($position eq 'middle') {
+	my $maxnum = 0;      
         my %defaults;
         if (ref($settings) eq 'HASH') {
             if ((ref($settings->{'inststatusorder'}) eq 'ARRAY') && (ref($settings->{'inststatustypes'}) eq 'HASH')) {
-                my $maxnum = @{$settings->{'inststatusorder'}};
+                $maxnum = @{$settings->{'inststatusorder'}};
                 for (my $i=0; $i<$maxnum; $i++) {
                     $css_class = $rownum%2?' class="LC_odd_row"':'';
                     my $item = $settings->{'inststatusorder'}->[$i];
                     my $title = $settings->{'inststatustypes'}->{$item};
+                    my $arialabel = &mt('List order for institutional user type: [_1]',$title);
                     my $chgstr = ' onchange="javascript:reorderTypes(this.form,'."'$item'".');"';
                     $datatable .= '<tr'.$css_class.'>'.
                                   '<td><span class="LC_nobreak">'.
-                                  '<select name="inststatus_pos_'.$item.'"'.$chgstr.'>';
+                                  '<select name="inststatus_pos_'.$item.'"'.$chgstr.' aria-label="'.$arialabel.'">';
                     for (my $k=0; $k<=$maxnum; $k++) {
                         my $vpos = $k+1;
                         my $selstr;
@@ -10943,44 +11273,48 @@
                         $datatable .= '<option value="'.$k.'"'.$selstr.'>'.$vpos.'</option>';
                     }
                     $datatable .= '</select> '.&mt('Internal ID:').' <b>'.$item.'</b> '.
-                                  '<input type="checkbox" name="inststatus_delete" value="'.$item.'" />'.
+                                  '<input type="checkbox" name="inststatus_delete" value="'.$item.'" aria-label="'.&mt('Delete institutional user type: [_1]',$title).'" />'.
                                   &mt('delete').'</span></td>'.
                                   '<td class="LC_left_item" colspan="2"><span class="LC_nobreak">'.&mt('Name displayed').':'.
-                                  '<input type="text" size="20" name="inststatus_title_'.$item.'" value="'.$title.'" />'.
+                                  '<input type="text" size="20" name="inststatus_title_'.$item.'" value="'.$title.'" aria-label="'.&mt('Name displayed for institutional user type: [_1]',$item).'"  />'.
                                   '</span></td></tr>';
                 }
-                $css_class = $rownum%2?' class="LC_odd_row"':'';
-                my $chgstr = ' onchange="javascript:reorderTypes(this.form,'."'addinststatus_pos'".');"';
-                $datatable .= '<tr '.$css_class.'>'.
-                              '<td><span class="LC_nobreak"><select name="addinststatus_pos"'.$chgstr.'>';
-                for (my $k=0; $k<=$maxnum; $k++) {
-                    my $vpos = $k+1;
-                    my $selstr;
-                    if ($k == $maxnum) {
-                        $selstr = ' selected="selected" ';
-                    }
-                    $datatable .= '<option value="'.$k.'"'.$selstr.'>'.$vpos.'</option>';
-                }
-                $datatable .= '</select> '.&mt('Internal ID:').
-                              '<input type="text" size="10" name="addinststatus" value="" />'.
-                              ' '.&mt('(new)').
-                              '</span></td><td class="LC_left_item" colspan="2"><span class="LC_nobreak">'.
-                              &mt('Name displayed').':'.
-                              '<input type="text" size="20" name="addinststatus_title" value="" /></span></td>'.
-                              '</tr>'."\n";
-                $rownum ++;
             }
         }
+        $css_class = $rownum%2?' class="LC_odd_row"':'';
+        my $chgstr = ' onchange="javascript:reorderTypes(this.form,'."'addinststatus_pos'".');"';
+        my $labeltext = &mt('List order for new institutional user type');
+        $datatable .= '<tr '.$css_class.'>'.
+                      '<td><span class="LC_nobreak"><select name="addinststatus_pos"'.$chgstr.' aria-label="'.$labeltext.'">';
+        for (my $k=0; $k<=$maxnum; $k++) {
+            my $vpos = $k+1;
+            my $selstr;
+            if ($k == $maxnum) {
+                $selstr = ' selected="selected" ';
+            }
+            $datatable .= '<option value="'.$k.'"'.$selstr.'>'.$vpos.'</option>';
+        }
+        $datatable .= '</select> '.&mt('Internal ID:').
+                      '<input type="text" size="10" name="addinststatus" value="" aria-label="'.&mt('Add new institutional user type').'" />'.
+                      ' '.&mt('(new)').
+                      '</span></td><td class="LC_left_item" colspan="2"><span class="LC_nobreak">'.
+                      &mt('Name displayed').':'.
+                      '<input type="text" size="20" name="addinststatus_title" value="" aria-label="'.&mt('Name displayed for new institutional user type').'" /></span></td>'.
+                      '</tr>'."\n";
+        $rownum ++;
     } else {
         my ($unamemaprules,$ruleorder) =
             &Apache::lonnet::inst_userrules($dom,'unamemap');
         $css_class = $rownum%2?' class="LC_odd_row"':'';
         if ((ref($unamemaprules) eq 'HASH') && (ref($ruleorder) eq 'ARRAY')) {
             my $numinrow = 2;
-            $datatable .= '<tr'.$css_class.'><td>'.&mt('Available conversions').'</td><td><table>'.
-                          &user_formats_row('unamemap',$settings,$unamemaprules,
-                                            $ruleorder,$numinrow).
-                          '</table></td></tr>';
+            if (@{$ruleorder} > 0) {
+                $datatable .= '<tr'.$css_class.'><td>'.&mt('Available conversions').'</td><td>'.
+                              '<div class="LC_grid" role="grid">'.
+                              &user_formats_row('unamemap',$settings,$unamemaprules,
+                                                $ruleorder,$numinrow).
+                              '</div></td></tr>;'
+            }
         }
         if ($datatable eq '') {
             $datatable .= '<tr'.$css_class.'><td colspan="2">'.
@@ -11233,7 +11567,7 @@
             $datatable .= &mt('Upload to library server: [_1]',$switchserver);
         } else {
             $datatable .='<span class="LC_nobreak"> '.
-                         '<input type="file" name="scantronformat" /></span>';
+                         '<input type="file" name="scantronformat" aria-label="'.&mt('Bubblesheet format file to upload').'" /></span>';
         }
     }
     $datatable .= '</td></tr>';
@@ -11307,56 +11641,60 @@
         $checked{'dat'} = $is_checked;
     }
     $onclick{'csv'} = ' onclick="toggleScantron(this.form);"';
+    my $title = &mt('Supported formats');
     my $css_class = $itemcount%2? ' class="LC_odd_row"':'';
-    $datatable = '<tr '.$css_class.'><td>'.&mt('Supported formats').'</td>'.
-                 '<td class="LC_left_item" valign="top"><span class="LC_nobreak">';
+    $datatable = '<tr '.$css_class.'><td>'.$title.'</td>'.
+                 '<td class="LC_left_item" valign="top">'.
+                 '<fieldset class="LC_borderless">'.
+                 '<legend class="LC_visually_hidden">'.$title.'</legend>'.
+                 '<span class="LC_nobreak">';
     foreach my $item ('dat','csv') {
         my $id;
         if ($item eq 'csv') {
             $id = 'id="scantronconfcsv" ';
         }
-        $datatable .= '<label><input type="checkbox" name="scantronconfig" '.$id.'value="'.$item.'"'.$checked{$item}.$onclick{$item}.' />'.
+        $datatable .= '<label><input type="checkbox" name="scantronconfig" '.$id.
+                      'value="'.$item.'"'.$checked{$item}.$onclick{$item}.' />'.
                       $titles{$item}.'</label>'.(' 'x3);
-        if ($item eq 'csv') {
-            $datatable .= '<fieldset style="display:'.$currcsvsty.'" id="scantroncsv_cols">'.
-                          '<legend>'.&mt('CSV Column Mapping').'</legend>'.
-                          '<table><tr><th>'.&mt('Field').'</th><th>'.&mt('Location').'</th></tr>'."\n";
-            foreach my $col (@fields) {
-                my $selnone;
-                if ($csvfields{$col} eq '') {
-                    $selnone = ' selected="selected"';
-                }
-                $datatable .= '<tr><td>'.$titles{$col}.'</td>'.
-                              '<td><select name="scantronconfig_csv_'.$col.'" class="scantronconfig_csv">'.
-                              '<option value=""'.$selnone.'></option>';
-                for (my $i=0; $i<20; $i++) {
-                    my $shown = $i+1;
-                    my $sel;
-                    unless ($selnone) {
-                        if (exists($csvfields{$col})) {
-                            if ($csvfields{$col} == $i) {
-                                $sel = ' selected="selected"';
-                            }
-                        }
+    }
+    $datatable .= '</span></fieldset>'.
+                  '<fieldset style="display:'.$currcsvsty.'" id="scantroncsv_cols">'.
+                  '<legend>'.&mt('CSV Column Mapping').'</legend>'.
+                  '<table><tr><th>'.&mt('Field').'</th><th>'.&mt('Location').'</th></tr>'."\n";
+    foreach my $col (@fields) {
+        my $selnone;
+        if ($csvfields{$col} eq '') {
+            $selnone = ' selected="selected"';
+        }
+        $datatable .= '<tr><td><label for="scantronconfig_csv_'.$col.'">'.$titles{$col}.'</label></td>'.
+                      '<td><select name="scantronconfig_csv_'.$col.'" id="scantronconfig_csv_'.$col.'" class="scantronconfig_csv">'.
+                      '<option value=""'.$selnone.'></option>';
+                      '<option value=""'.$selnone.'></option>';
+        for (my $i=0; $i<20; $i++) {
+            my $shown = $i+1;
+            my $sel;
+            unless ($selnone) {
+                if (exists($csvfields{$col})) {
+                    if ($csvfields{$col} == $i) {
+                        $sel = ' selected="selected"';
                     }
-                    $datatable .= '<option value="'.$i.'"'.$sel.'>'.$shown.'</option>';
                 }
-                $datatable .= '</select></td></tr>';
-           }
-           $datatable .= '</table></fieldset>'.
-                         '<fieldset style="display:'.$currcsvsty.'" id="scantroncsv_options">'.
-                         '<legend>'.&mt('CSV Options').'</legend>';
-           foreach my $option ('hdr','pad','rem') {
-               $datatable .= '<span class="LC_nobreak">'.$titles{$option}.':'.
-                         '<label><input type="radio" name="scantroncsv_'.$option.'" value="1"'.$optionson{$option}.' />'.
-                         &mt('Yes').'</label>'.(' 'x2)."\n".
-                         '<label><input type="radio" name="scantroncsv_'.$option.'" value="0"'.$optionsoff{$option}.' />'.&mt('No').'</label></span><br />';
-           }
-           $datatable .= '</fieldset>';
-           $itemcount ++;
-        }
+            }
+            $datatable .= '<option value="'.$i.'"'.$sel.'>'.$shown.'</option>';
+        }
+        $datatable .= '</select></td></tr>';
+    }
+    $datatable .= '</table></fieldset>'.
+                  '<fieldset style="display:'.$currcsvsty.'" id="scantroncsv_options">'.
+                  '<legend>'.&mt('CSV Options').'</legend>';
+    foreach my $option ('hdr','pad','rem') {
+        $datatable .= '<span class="LC_nobreak">'.$titles{$option}.':'.
+                      '<label><input type="radio" name="scantroncsv_'.$option.'" value="1"'.$optionson{$option}.' />'.
+                      &mt('Yes').'</label>'.(' 'x2)."\n".
+                      '<label><input type="radio" name="scantroncsv_'.$option.'" value="0"'.$optionsoff{$option}.' />'.&mt('No').'</label></span><br />';
     }
-    $datatable .= '</td></tr>';
+    $datatable .= '</fieldset></td></tr>';
+    $itemcount ++;
     $$rowtotal ++;
     return $datatable;
 }
@@ -11412,9 +11750,12 @@
        my $itemcount = 0;
        foreach my $item (@catitems) {
            my $css_class = $itemcount%2? ' class="LC_odd_row"':'';
-           $datatable .= '<tr '.$css_class.'>'.
-                         '<td>'.$lt{$item}.'</td>'.
-                         '<td class="LC_right_item"><span class="LC_nobreak">';
+           $datatable .= '<tr'.$css_class.'>'.
+                         '<td style="line-height: 175%;">'.$lt{$item}.'</td>'.
+                         '<td class="LC_right_item">'.
+                         '<fieldset class="LC_borderless">'.
+                         '<legend class="LC_visually_hidden">'.$lt{$item}.'</legend>'.
+                         '<span class="LC_nobreak">';
            foreach my $type (@cattypes) {
                my $ischecked;
                if ($checked{$item} eq $type) {
@@ -11424,7 +11765,7 @@
                              '<input type="radio" name="coursecat_'.$item.'" value="'.$type.'"'.$ischecked.
                              ' />'.$lt{$type}.'</label> ';
            }
-           $datatable .= '</span></td></tr>';
+           $datatable .= '</span></fieldset></td></tr>';
            $itemcount ++;
         }
         $$rowtotal += $itemcount;
@@ -11483,48 +11824,66 @@
                      place => 'Set in Placement Test',
                     );
         $datatable = '<tr class="LC_odd_row">'.
-                  '<td>'.$title{'togglecats'}.'</td>'.
-                  '<td class="LC_right_item"><span class="LC_nobreak"><label>'.
+                  '<td style="line-height: 170%;">'.$title{'togglecats'}.'</td>'.
+                  '<td class="LC_right_item">'.
+                  '<fieldset class="LC_borderless">'.
+                  '<legend class="LC_visually_hidden">'.$title{'togglecats'}.'</legend>'.
+                  '<span class="LC_nobreak"><label>'.
                   '<input type="radio" name="togglecats"'.
                   $toggle_cats_dom.' value="dom" />'.$level{'dom'}.'</label> '.
                   '<label><input type="radio" name="togglecats"'.
-                  $toggle_cats_crs.' value="crs" />'.$level{'crs'}.'</label></span></td>'.
-                  '</tr><tr>'.
-                  '<td>'.$title{'categorize'}.'</td>'.
-                  '<td class="LC_right_item"><span class="LC_nobreak">'.
+                  $toggle_cats_crs.' value="crs" />'.$level{'crs'}.'</label></span>'.
+                  '</fieldset></td></tr><tr>'.
+                  '<td style="line-height: 170%;">'.$title{'categorize'}.'</td>'.
+                  '<td class="LC_right_item">'.
+                  '<fieldset class="LC_borderless">'.
+                  '<legend class="LC_visually_hidden">'.$title{'categorize'}.'</legend>'.
+                  '<span class="LC_nobreak">'.
                   '<label><input type="radio" name="categorize"'.
                   $can_cat_dom.' value="dom" />'.$level{'dom'}.'</label> '.
                   '<label><input type="radio" name="categorize"'.
-                  $can_cat_crs.'value="crs" />'.$level{'crs'}.'</label></span></td>'.
-                  '</tr><tr class="LC_odd_row">'.
-                  '<td>'.$title{'togglecatscomm'}.'</td>'.
-                  '<td class="LC_right_item"><span class="LC_nobreak"><label>'.
+                  $can_cat_crs.'value="crs" />'.$level{'crs'}.'</label></span>'.
+                  '</fieldset></td></tr><tr class="LC_odd_row">'.
+                  '<td style="line-height: 170%;">'.$title{'togglecatscomm'}.'</td>'.
+                  '<td class="LC_right_item">'.
+                  '<fieldset class="LC_borderless">'.
+                  '<legend class="LC_visually_hidden">'.$title{'togglecatscomm'}.'</legend>'.
+		  '<span class="LC_nobreak"><label>'.
                   '<input type="radio" name="togglecatscomm"'.
                   $toggle_catscomm_dom.' value="dom" />'.$level{'dom'}.'</label> '.
                   '<label><input type="radio" name="togglecatscomm"'.
-                  $toggle_catscomm_comm.' value="comm" />'.$level{'comm'}.'</label></span></td>'.
-                  '</tr><tr>'.
-                  '<td>'.$title{'categorizecomm'}.'</td>'.
-                  '<td class="LC_right_item"><span class="LC_nobreak">'.
+                  $toggle_catscomm_comm.' value="comm" />'.$level{'comm'}.'</label></span>'.
+                  '</fieldset></td></tr><tr>'.
+                  '<td style="line-height: 170%;">'.$title{'categorizecomm'}.'</td>'.
+                  '<td class="LC_right_item">'.
+                  '<fieldset class="LC_borderless">'.
+                  '<legend class="LC_visually_hidden">'.$title{'categorizecomm'}.'</legend>'.
+                  '<span class="LC_nobreak">'.
                   '<label><input type="radio" name="categorizecomm"'.
                   $can_catcomm_dom.' value="dom" />'.$level{'dom'}.'</label> '.
                   '<label><input type="radio" name="categorizecomm"'.
-                  $can_catcomm_comm.'value="comm" />'.$level{'comm'}.'</label></span></td>'.
-                  '</tr><tr class="LC_odd_row">'.
-                  '<td>'.$title{'togglecatsplace'}.'</td>'.
-                  '<td class="LC_right_item"><span class="LC_nobreak"><label>'.
+                  $can_catcomm_comm.'value="comm" />'.$level{'comm'}.'</label></span>'.
+                  '</fieldset></td></tr><tr class="LC_odd_row">'.
+                  '<td style="line-height: 170%;">'.$title{'togglecatsplace'}.'</td>'.
+                  '<td class="LC_right_item">'.
+                  '<fieldset class="LC_borderless">'.
+                  '<legend class="LC_visually_hidden">'.$title{'togglecatsplace'}.'</legend>'.
+                  '<span class="LC_nobreak"><label>'.
                   '<input type="radio" name="togglecatsplace"'.
                   $toggle_catsplace_dom.' value="dom" />'.$level{'dom'}.'</label> '.
                   '<label><input type="radio" name="togglecatscomm"'.
-                  $toggle_catsplace_place.' value="comm" />'.$level{'place'}.'</label></span></td>'.
-                  '</tr><tr>'.
-                  '<td>'.$title{'categorizeplace'}.'</td>'.
-                  '<td class="LC_right_item"><span class="LC_nobreak">'.
+                  $toggle_catsplace_place.' value="comm" />'.$level{'place'}.'</label></span>'.
+                  '</fieldset></td></tr><tr>'.
+                  '<td style="line-height: 170%;">'.$title{'categorizeplace'}.'</td>'.
+                  '<td class="LC_right_item">'.
+                  '<fieldset class="LC_borderless">'.
+                  '<legend class="LC_visually_hidden">'.$title{'categorizeplace'}.'</legend>'.
+                  '<span class="LC_nobreak">'.
                   '<label><input type="radio" name="categorizeplace"'.
                   $can_catplace_dom.' value="dom" />'.$level{'dom'}.'</label> '.
                   '<label><input type="radio" name="categorizeplace"'.
-                  $can_catplace_place.'value="place" />'.$level{'place'}.'</label></span></td>'.
-                  '</tr>';
+                  $can_catplace_place.'value="place" />'.$level{'place'}.'</label></span>'.
+                  '</fieldset></td></tr>';
         $$rowtotal += 6;
     } else {
         my $css_class;
@@ -11566,10 +11925,17 @@
                         my $parent = $cats[0][$i];
                         $css_class = $itemcount%2?' class="LC_odd_row"':'';
                         my $item = &escape($parent).'::0';
+                        my $shownum = $i+1;
                         my $chgstr = ' onchange="javascript:reorderCats(this.form,'."'','$item','$idx{$item}'".');"';
+                        my $labeltext;
+			if ($parent eq 'instcode' || $parent eq 'communities' || $parent eq 'placement') {
+                            $labeltext = &mt('Set order for item [_1] in [_2]',$shownum,$default_names{$parent});
+                        } else {
+                            $labeltext = &mt('Set order for item [_1] with parent: [_2]',$shownum,$parent); 
+                        }
                         $lastidx = $idx{$item};
-                        $datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">'
-                                      .'<select name="'.$item.'"'.$chgstr.'>';
+                        $datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'
+                                      .'<select name="'.$item.'"'.$chgstr.' aria-label="'.$labeltext.'">';
                         for (my $k=0; $k<=$maxnum; $k++) {
                             my $vpos = $k+1;
                             my $selstr;
@@ -11586,8 +11952,13 @@
                                 $datatable .= '<br /><span class="LC_nobreak">('
                                               .&mt('with institutional codes')
                                               .')</span></td><td'.$colattrib.'>';
-                            } else {
-                                $datatable .= '<table><tr><td>';
+                            }
+                            $datatable .= '<fieldset class="LC_borderless" style="line-height: 175%;">'
+                                         .'<legend class="LC_visually_hidden">'.$default_names{$parent}.'</legend>';
+                            if (($parent eq 'communities') || ($parent eq 'placement')) {
+                                $datatable .= '<div class="LC_grid" role="grid">'.
+                                              '<div class="LC_grid_row" role="row">'.
+                                              '<div class="LC_grid_cell" role="gridcell">'; 
                             }
                             $datatable .= '<span class="LC_nobreak">'
                                           .'<label><input type="radio" name="'
@@ -11596,16 +11967,18 @@
                             if ($parent eq 'instcode') {
                                 $datatable .= ' ';
                             } else {
-                                $datatable .= '</span></td></tr><tr><td>'
-                                              .'<span class="LC_nobreak">';
+                                $datatable .= '</span></div></div>'.
+                                              '<div class="LC_grid_row" role="row">'.
+                                              '<div class="LC_grid_cell" role="gridcell">'.
+                                              '<span class="LC_nobreak">';
                             }
                             $datatable .= '<label><input type="radio" name="'
                                           .$parent.'" value="0" />'
                                           .&mt('Do not display').'</label></span>';
                             if (($parent eq 'communities') || ($parent eq 'placement')) {
-                                $datatable .= '</td></tr></table>';
+                                $datatable .= '</div></div></div>';
                             }
-                            $datatable .= '</td>';
+                            $datatable .= '</fieldset></td>';
                         } else {
                             $datatable .= $parent
                                           .' <span class="LC_nobreak"><label>'
@@ -11621,7 +11994,8 @@
                     }
                     $css_class = $itemcount%2?' class="LC_odd_row"':'';
                     my $chgstr = ' onchange="javascript:reorderCats(this.form,'."'','addcategory_pos','$lastidx'".');"';
-                    $datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak"><select name="addcategory_pos"'.$chgstr.'>';
+                    my $arialabel = &mt('Set order for new top level category'); 
+                    $datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak"><select name="addcategory_pos"'.$chgstr.' aria-label="'.$arialabel.'">';
                     for (my $k=0; $k<=$maxnum; $k++) {
                         my $vpos = $k+1;
                         my $selstr;
@@ -11630,16 +12004,17 @@
                         }
                         $datatable .= '<option value="'.$k.'"'.$selstr.'>'.$vpos.'</option>';
                     }
-                    $datatable .= '</select></span></td><td colspan="2">'.&mt('Add category:').' '
-                                  .'<input type="text" size="20" name="addcategory_name" value="" /></td>'
+                    $datatable .= '</select></span></td><td colspan="2"><label>'.&mt('Add category:').' '
+                                  .'<input type="text" size="20" name="addcategory_name" value="" /></label></td>'
                                   .'</tr>'."\n";
                     $itemcount ++;
                     foreach my $default ('instcode','communities','placement') {
                         if ((!grep(/^\Q$default\E$/,@{$cats[0]})) || ($cathash->{$default.'::0'} eq '')) {
                             $css_class = $itemcount%2?' class="LC_odd_row"':'';
                             my $chgstr = ' onchange="javascript:reorderCats(this.form,'."'','$default"."_pos','$lastidx'".');"';
-                            $datatable .= '<tr><td colspan="'.$maxdepth.'" class="LC_row_separator"></td></tr><tr '.$css_class.'><td>'.
-                                          '<span class="LC_nobreak"><select name="'.$default.'_pos"'.$chgstr.'>';
+                            my $labeltext = &mt('Set order for category [_1]',$default_names{$default});
+                            $datatable .= '<tr><td colspan="'.$maxdepth.'" class="LC_row_separator"></td></tr><tr'.$css_class.'><td>'.
+                                          '<span class="LC_nobreak"><select name="'.$default.'_pos"'.$chgstr.' aria-label="'.$labeltext.'">';
                             for (my $k=0; $k<=$maxnum; $k++) {
                                 my $vpos = $k+1;
                                 my $selstr;
@@ -11656,10 +12031,12 @@
                                               .&mt('with institutional codes').')</span>';
                             }
                             $datatable .= '</td>'
-                                          .'<td><span class="LC_nobreak"><label><input type="radio" name="'.$default.'" value="1" />'
+                                          .'<td><fieldset class="LC_borderless" style="line-height: 175%;">'
+                                          .'<legend class="LC_visually_hidden">'.$default_names{$default}.'</legend>'
+					  .'<span class="LC_nobreak"><label><input type="radio" name="'.$default.'" value="1" />'
                                           .&mt('Display').'</label> '
                                           .'<label><input type="radio" name="'.$default.'" value="0" checked="checked"/>'
-                                          .&mt('Do not display').'</label></span></td></tr>';
+                                          .&mt('Do not display').'</label></span></fieldset></td></tr>';
                         }
                     }
                 }
@@ -11667,8 +12044,7 @@
                 $datatable .= &initialize_categories($itemcount);
             }
         } else {
-            $datatable .= '<tr><td class="LC_right_item">'.$hdritem->{'header'}->[1]->{'col2'}.'</td></tr>'
-                          .&initialize_categories($itemcount);
+            $datatable .= &initialize_categories($itemcount);
         }
         $$rowtotal += $itemcount;
     }
@@ -11706,15 +12082,15 @@
         $rownum ++;
         $css_class = $rownum%2?' class="LC_odd_row"':'';
         $datatable .= '<tr'.$css_class.'>'.
-                      '<td><span class="LC_nobreak">'.
-                      $titles->{$type}.'</span></td>'.
+                      '<th id="statusrow'.$rownum.'" scope="row" class="LC_rowheader">'.
+		      '<span class="LC_nobreak">'.$titles->{$type}.'</span></th>'.
                       '<td class="LC_left_item">'.
                       '<input type="text" name="'.$type.'_namedusers" '.
-                      'value="'.$namedaccess{$type}.'" size="30" /></td>'.
+                      'value="'.$namedaccess{$type}.'" size="30" aria-labelledby="colheader2 statusrow'.$rownum.'" /></td>'.
                       '<td class="LC_right_item">'.
                       '<span class="LC_nobreak">'.
                       '<input type="text" name="'.$type.'_machines" '.
-                      'value="'.$machineaccess{$type}.'" size="10" />'.
+                      'value="'.$machineaccess{$type}.'" size="10" aria-labelledby="colheader3 statusrow'.$rownum.'" />'.
                       '</span></td></tr>'."\n";
     }
     $$rowtotal += $rownum;
@@ -12055,30 +12431,36 @@
         $chgstr = ' onchange="javascript:reorderCats(this.form,'."'','$default"."_pos','0'".');"';
         map { $selected{$selnum{$_}} = '' } keys(%selnum);
         $selected{$selnum{$default}} = ' selected="selected"';
+        my $labeltext = &mt('Set order for category: [_1]',$default_names{$default});
         $datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">'
-                     .'<select name="'.$default.'_pos"'.$chgstr.'>'
+                     .'<select name="'.$default.'_pos"'.$chgstr.' aria-label="'.$labeltext.'">'
                      .'<option value="0"'.$selected{'0'}.'>1</option>'
                      .'<option value="1"'.$selected{'1'}.'>2</option>'
                      .'<option value="2"'.$selected{'2'}.'>3</option>'
                      .'<option value="3">4</option></select> '
                      .$default_names{$default}
-                     .'</span></td><td><span class="LC_nobreak">'
+                     .'</span></td><td colspan="2" class="LC_left_item">'
+                     .'<fieldset class="LC_borderless" style="line-height: 175%;">'
+                     .'<legend class="LC_visually_hidden">'.$default_names{$default}.'</legend>'
+                     .'<span class="LC_nobreak">'
                      .'<label><input type="radio" name="'.$default.'" value="1" checked="checked" />'
                      .&mt('Display').'</label> <label>'
                      .'<input type="radio" name="'.$default.'" value="0" />'.&mt('Do not display')
-                 .'</label></span></td></tr>';
+                     .'</label></span></fieldset></td></tr>';
         $itemcount ++;
     }
     $css_class = $itemcount%2?' class="LC_odd_row"':'';
     $chgstr = ' onchange="javascript:reorderCats(this.form,'."'','addcategory_pos','0'".');"';
+    my $addcat = &mt('Add category');
+    my $arialabel = &mt('Set order for new top level category');
     $datatable .= '<tr '.$css_class.'><td><span class="LC_nobreak">'
-                  .'<select name="addcategory_pos"'.$chgstr.'>'
+                  .'<select name="addcategory_pos"'.$chgstr.' aria-label="'.$arialabel.'">'
                   .'<option value="0">1</option>'
                   .'<option value="1">2</option>'
                   .'<option value="2">3</option>'
                   .'<option value="3" selected="selected">4</option></select> '
-                  .&mt('Add category').'</span></td><td><span class="LC_nobreak">'.&mt('Name:')
-                  .' <input type="text" size="20" name="addcategory_name" value="" /></span>'
+                  .$addcat.'</span></td><td><span class="LC_nobreak" colspan="2">'.&mt('Name:')
+                  .' <input type="text" size="20" name="addcategory_name" value="" aria-label="'.$addcat.'" /></span>'
                   .'</td></tr>';
     return $datatable;
 }
@@ -12091,8 +12473,10 @@
         if (ref($cats->[$depth]) eq 'HASH') {
             if (ref($cats->[$depth]{$parent}) eq 'ARRAY') {
                 my $numchildren = @{$cats->[$depth]{$parent}};
-                my $css_class = $itemcount%2?' class="LC_odd_row"':'';
-                $text .= '<td><table class="LC_data_table">';
+                $text = '<td><table style="margin: 0; border: 1px solid black;">'.
+                        '<tr class="LC_visually_hidden">'.
+                        '<th>'.&mt('Subcategory Names').'</th>'.
+                        '<th colspan="2">'.&mt('Contents').'</th></tr>';
                 my ($idxnum,$parent_name,$parent_item);
                 my $higher = $depth - 1;
                 if ($higher == 0) {
@@ -12112,8 +12496,11 @@
                         $name = $parent_name;
                         $item = $parent_item;
                     }
+                    my $shownum = $j+1;
+                    my $label = &mt('Set order for item [_1] in parent [_2]',$shownum,$parent);
                     $chgstr = ' onchange="javascript:reorderCats(this.form,'."'$parent_name','$item','$idxnum'".');"';
-                    $text .= '<tr '.$css_class.'><td><span class="LC_nobreak"><select name="'.$item.'"'.$chgstr.'>';
+                    $text .= '<tr><td style="line-height: 200%;"><span class="LC_nobreak">'.
+                             '<select name="'.$item.'"'.$chgstr.' aria-label="'.$label.'">';
                     for (my $i=0; $i<=$numchildren; $i++) {
                         my $vpos = $i+1;
                         my $selstr;
@@ -12127,22 +12514,23 @@
                         my $deeper = $depth+1;
                         $text .= $name.' '
                                  .'<label><input type="checkbox" name="deletecategory" value="'
-                                 .$item.'" />'.&mt('Delete').'</label></span></td><td>';
+                                 .$item.'" />'.&mt('Delete').'</label></span></td>';
                         if(ref($path) eq 'ARRAY') {
                             push(@{$path},$name);
                             $text .= &build_category_rows($itemcount,$cats,$deeper,$name,$path,$idx);
                             pop(@{$path});
                         }
                     } else {
-                        $text .= &mt('Add subcategory:').' </span><input type="text" size="20" name="addcategory_name_';
+                        my $elemname = 'addcategory_name_'; 
                         if ($j == $numchildren) {
-                            $text .= $name;
+                            $elemname .= $name;
                         } else {
-                            $text .= $item;
+                            $elemname .= $item;
                         }
-                        $text .= '" value="" />';
+                        $text .= '<label for="'.$elemname.'">'.&mt('Add subcategory:').'</label> </span>'.
+                                 '<input type="text" size="20" name="'.$elemname.'" id="'.$elemname.'" value="" /></td>';
                     }
-                    $text .= '</td></tr>';
+                    $text .= '</tr>';
                 }
                 $text .= '</table></td>';
             } else {
@@ -12157,7 +12545,10 @@
                 my $colspan;
                 if ($parent ne 'instcode') {
                     $colspan = $maxdepth - $depth - 1;
-                    $text .= '<td colspan="'.$colspan.'">'.&mt('Add subcategory:').'<input type="text" size="20" name="subcat_'.$name.'" value="" /></td>';
+                    $text .= '<td colspan="'.$colspan.'">'.
+                             '<label>'.&mt('Add subcategory:').
+                             '<input type="text" size="20" name="subcat_'.$name.'" value="" />'.
+                             '</label></td>';
                 }
             }
         }
@@ -12229,9 +12620,16 @@
     if ($rowid) {
         $rowid = ' id="'.$rowid.'"';
     }
-    $output = '<tr '.$css_class.$rowid.'>'.
-              '<td><span class="LC_nobreak">'.$rolename.'</span></td>'.
-              '<td class="LC_left_item" colspan="2"><table>';
+    $output = '<tr '.$css_class.$rowid.'>';
+    if ($context eq 'lti') {
+        $output .= '<th class="LC_rowheader" scope="row"><span class="LC_nobreak">'.$rolename.'</span></th>';
+    } else {
+        $output .= '<td><span class="LC_nobreak">'.$rolename.'</span></td>';
+    }
+    $output .= '<td class="LC_left_item" colspan="2">'.
+               '<fieldset class="LC_borderless" style="line-height: 170%;">'.
+               '<legend class="LC_visually_hidden">'.$rolename.'</legend>'.
+               '<div class="LC_grid" role="grid">';
     my $rem;
     my %checks;
     if (ref($settings) eq 'HASH') {
@@ -12280,9 +12678,9 @@
         $rem = $i%($numinrow);
         if ($rem == 0) {
             if ($i > 0) {
-                $output .= '</tr>';
+                $output .= '</div>';
             }
-            $output .= '<tr>';
+            $output .= '<div class="LC_grid_row" role="row">';
         }
         my $check = ' ';
         unless ($role eq 'emailusername') {
@@ -12314,7 +12712,7 @@
                 }
             }
         }
-        $output .= '<td class="LC_left_item">'.
+        $output .= '<div class="LC_grid_cell" role="gridcell">'.
                    '<span class="LC_nobreak">';
         my $prefix = 'canmodify';
         if ($role eq 'emailusername') {
@@ -12344,20 +12742,9 @@
                        'value="'.$fields[$i].'"'.$check.'/>'.$fieldtitles{$fields[$i]}.
                        '</label>';
         }
-        $output .= '</span></td>';
+        $output .= '</span></div>';
     }
-    $rem = $total%$numinrow;
-    my $colsleft;
-    if ($rem) {
-        $colsleft = $numinrow - $rem;
-    }
-    if ($colsleft > 1) {
-        $output .= '<td colspan="'.$colsleft.'" class="LC_left_item">'.
-                   ' </td>';
-    } elsif ($colsleft == 1) {
-        $output .= '<td class="LC_left_item"> </td>';
-    }
-    $output .= '</tr></table></td></tr>';
+    $output .= '</div></div></fieldset></td></tr>';
     return $output;
 }
 
@@ -12402,7 +12789,10 @@
     }
     my $output = '<tr'.$css_class.'>'.
                  '<td>'.$lt{$context}.$showdom.
-                 '</td><td class="'.$class.'" colspan="2"><table>';
+                 '</td><td class="'.$class.'" colspan="2">'.
+                 '<fieldset class="LC_borderless" style="margin: 0;">'.
+                 '<legend class="LC_visually_hidden">'.&mt('Select affiliations').'</legend>'.
+                 '<div class="LC_grid" role="grid" style="margin: 0;">';
     my $rem;
     if (ref($types) eq 'ARRAY') {
         for (my $i=0; $i<@{$types}; $i++) {
@@ -12410,9 +12800,9 @@
                 my $rem = $i%($numinrow);
                 if ($rem == 0) {
                     if ($i > 0) {
-                        $output .= '</tr>';
+                        $output .= '</div>';
                     }
-                    $output .= '<tr>';
+                    $output .= '<div class="LC_grid_row" role="row">';
                 }
                 if ($context eq 'authorquota') {
                     my $currquota;
@@ -12421,12 +12811,12 @@
                     } else {
                         $currquota = $defaultquota;
                     }
-                    $output .= '<td class="LC_left_item">'."\n".
+                    $output .= '<div class="LC_grid_cell" role="gridcell">'."\n".
                                '<label><span class="LC_nobreak">'."\n".
                                $usertypes->{$types->[$i]}.'</span><br />'."\n".
                                '<input type="text" name="'.$context.'_'.$types->[$i].'" '.
                                'value="'.$currquota.'" size="5"'.$onclick.'/>'."\n".
-                               '</label></td>';
+                               '</label></div>';
                 } else {
                     my $check = ' ';
                     if (ref($settings) eq 'HASH') {
@@ -12446,33 +12836,23 @@
                             $check = ' checked="checked" ';
                         }
                     }
-                    $output .= '<td class="LC_left_item">'.
+                    $output .= '<div class="LC_grid_cell" role="gridcell">'.
                                '<span class="LC_nobreak"><label>'.
                                '<input type="checkbox" name="'.$context.'" '.
                                'value="'.$types->[$i].'"'.$check.$onclick.'/>'.
-                               $usertypes->{$types->[$i]}.'</label></span></td>';
+                               $usertypes->{$types->[$i]}.'</label></span></div>';
                 }
             }
         }
         $rem = @{$types}%($numinrow);
     }
-    my $colsleft = $numinrow - $rem;
     if ($context eq 'overrides') {
-        if ($colsleft > 1) {
-            $output .= '<td colspan="'.$colsleft.'" class="LC_left_item">';
-        } else {
-            $output .= '<td class="LC_left_item">';
-        }
-        $output .= ' ';
+        $output .= '<div class="LC_grid_cell" role="gridcell"> ';
     } else {
         if ($rem == 0) {
-            $output .= '<tr>';
-        }
-        if ($colsleft > 1) {
-            $output .= '<td colspan="'.$colsleft.'" class="LC_left_item">';
-        } else {
-            $output .= '<td class="LC_left_item">';
+            $output .= '</div><div class="LC_grid_row" role="row">';
         }
+        $output .= '<div class="LC_grid_cell" role="gridcell">';
         if ($context eq 'authorquota') {
             my $currquota = 500;
             if ((ref($settings) eq 'HASH') && (ref($settings->{$context}) eq 'HASH')) {
@@ -12509,7 +12889,7 @@
                        $othertitle.'</label></span>';
         }
     }
-    $output .= '</td></tr></table></td></tr>';
+    $output .= '</div></div></div></fieldset></td></tr>';
     return $output;
 }
 
@@ -12542,14 +12922,17 @@
             $$rownums ++;
             my $css_class = $$rownums%2?' class="LC_odd_row"':'';
             $datatable .= '<tr'.$css_class.'><td>'.$usertypes->{$type}.
-                          '</td><td class="LC_left_item"><table>';
+                          '</td><td class="LC_left_item">'.
+                          '<fieldset class="LC_borderless" style="margin: 0;">'.
+                          '<legend class="LC_visually_hidden">'.&mt('Choose user data fields').'</legend>'.
+                          '<div class="LC_grid" role="grid" style="margin: 0;">';
             for (my $i=0; $i<@{$fields}; $i++) {
                 my $rem = $i%($numinrow);
                 if ($rem == 0) {
                     if ($i > 0) {
-                        $datatable .= '</tr>';
+                        $datatable .= '</div>';
                     }
-                    $datatable .= '<tr>';
+                    $datatable .= '<div class="LC_grid_row" role="row">';
                 }
                 my $check = ' ';
                 if (ref($settings) eq 'HASH') {
@@ -12561,23 +12944,13 @@
                         }
                     }
                 }
-
-                if ($i == @{$fields}-1) {
-                    my $colsleft = $numinrow - $rem;
-                    if ($colsleft > 1) {
-                        $datatable .= '<td colspan="'.$colsleft.'">';
-                    } else {
-                        $datatable .= '<td>';
-                    }
-                } else {
-                    $datatable .= '<td>';
-                }
-                $datatable .= '<span class="LC_nobreak"><label>'.
+                $datatable .= '<div class="LC_grid_cell" role="gridcell">'.
+                              '<span class="LC_nobreak"><label>'.
                               '<input type="checkbox" name="updateable_'.$type.
                               '_'.$fields->[$i].'" value="1"'.$check.'/>'.
-                              $fieldtitles->{$fields->[$i]}.'</label></span></td>';
+                              $fieldtitles->{$fields->[$i]}.'</label></span></div>';
             }
-            $datatable .= '</tr></table></td></tr>';
+            $datatable .= '</div></div></fieldset></td></tr>';
         }
     }
     return $datatable;
@@ -23714,7 +24087,7 @@
 }
 
 sub active_dc_picker {
-    my ($dom,$numinrow,$inputtype,$name,%currhash) = @_;
+    my ($dom,$numinrow,$inputtype,$name,$legend,%currhash) = @_;
     my %domcoords = &Apache::lonnet::get_active_domroles($dom,['dc']);
     my @domcoord = keys(%domcoords);
     if (keys(%currhash)) {
@@ -23729,14 +24102,16 @@
     my $rows = 0;
     my $table;
     if ($numdcs > 1) {
-        $table = '<table>';
+        $table = '<fieldset class="LC_borderless" style="line-height: 170%;">'.
+                 '<legend class="LC_visually_hidden">'.$legend.'</legend>'.
+                 '<div class="LC_grid" role="grid">';
         for (my $i=0; $i<@domcoord; $i++) {
             my $rem = $i%($numinrow);
             if ($rem == 0) {
                 if ($i > 0) {
-                    $table .= '</tr>';
+                    $table .= '</div>';
                 }
-                $table .= '<tr>';
+                $table .= '<div class="LC_grid_row" role="row">';
                 $rows ++;
             }
             my $check = '';
@@ -23753,16 +24128,7 @@
                     $check = ' checked="checked"';
                 }
             }
-            if ($i == @domcoord - 1) {
-                my $colsleft = $numinrow - $rem;
-                if ($colsleft > 1) {
-                    $table .= '<td class="LC_left_item" colspan="'.$colsleft.'">';
-                } else {
-                    $table .= '<td class="LC_left_item">';
-                }
-            } else {
-                $table .= '<td class="LC_left_item">';
-            }
+            $table .= '<div class="LC_grid_cell" role="gridcell">';
             my ($dcname,$dcdom) = split(':',$domcoord[$i]);
             my $user = &Apache::loncommon::plainname($dcname,$dcdom);
             $table .= '<span class="LC_nobreak"><label>'.
@@ -23771,9 +24137,9 @@
             if ($user ne $dcname.':'.$dcdom) {
                 $table .=  ' ('.$dcname.':'.$dcdom.')';
             }
-            $table .= '</label></span></td>';
+            $table .= '</label></span></div>';
         }
-        $table .= '</tr></table>';
+        $table .= '</div></div></fieldset>';
     } elsif ($numdcs == 1) {
         my ($dcname,$dcdom) = split(':',$domcoord[0]);
         my $user = &Apache::loncommon::plainname($dcname,$dcdom);


More information about the LON-CAPA-cvs mailing list