User:Timeshifter/Sandbox115

Expanding class=wikitable to make tables accessible to blind, and to align cell text.

Expanding what class=wikitable does could instantly solve a lot of problems the blind and visually impaired have with hundreds of thousands of tables on Wikipedia. And it would align row header cell text to the left. For more info see: User:Timeshifter/Sandbox114 and 115. See related discussion.

Standard class=wikitable table below. It includes style=text-align:right; overall, and align=left on first-column cells.

class="wikitable sortable mw-datatable" style=text-align:right;

|+ Correctional supervision rates by state, 2016.

rowspan=2|



Jurisdiction

! colspan=2|Total

! colspan=2|Community supervision

! colspan=2|Incarcerated

Total,
12/31/2016

! Rate per
100,000
adults

! Probation
or Parole,
12/31/2016

! Rate per
100,000
adults

! In prison
or jail,
12/31/2016

! Rate per
100,000
adults

align=left|{{flaglist|Alabama}}99,8002,64060,7001,61040,9001,080
align=left|{{flaglist|Alaska}}12,9002,3208,4001,5204,400800
align=left|{{flaglist|Arizona}}137,5002,57084,8001,59055,0001,030

The blind need scopes on all header cells. Added row headers, [https://www.w3schools.com/tags/att_th_scope.asp scope=row, scope=rowgroup, scope=col, scope=colgroup], class=plainrowheaders:

class="wikitable sortable mw-datatable plainrowheaders" style=text-align:right;

|+ Correctional supervision rates by state, 2016.

scope=rowgroup rowspan=2 |



Jurisdiction

! scope=colgroup colspan=2 |Total

! scope=colgroup colspan=2 |Community supervision

! scope=colgroup colspan=2 |Incarcerated

scope=col |Total,
12/31/2016

! scope=col |Rate per
100,000
adults

! scope=col |Probation
or Parole,
12/31/2016

! scope=col |Rate per
100,000
adults

! scope=col |In prison
or jail,
12/31/2016

! scope=col |Rate per
100,000
adults

scope=row |{{flaglist|Alabama}}

|| 99,800 || 2,640 || 60,700 || 1,610 || 40,900 || 1,080

scope=row |{{flaglist|Alaska}}

|| 12,900 || 2,320 || 8,400 || 1,520 || 4,400 || 800

scope=row |{{flaglist|Arizona}}

|| 137,500 || 2,570 || 84,800 || 1,590 || 55,000 || 1,030

Same as above. Added style=background-color:yellow; and style=background-color:lightyellow; - I made one cell light yellow to show a couple shades of yellow.

class="wikitable sortable mw-datatable plainrowheaders" style=text-align:right;

|+ Correctional supervision rates by state, 2016.

scope=rowgroup rowspan=2 style=background-color:lightyellow; |



Jurisdiction

! scope=colgroup colspan=2 style=background-color:yellow; |Total

! scope=colgroup colspan=2 style=background-color:yellow; |Community supervision

! scope=colgroup colspan=2 style=background-color:yellow; |Incarcerated

scope=col style=background-color:yellow; |Total,
12/31/2016

! scope=col style=background-color:yellow; |Rate per
100,000
adults

! scope=col style=background-color:yellow; |Probation
or Parole,
12/31/2016

! scope=col style=background-color:yellow; |Rate per
100,000
adults

! scope=col style=background-color:yellow; |In prison
or jail,
12/31/2016

! scope=col style=background-color:yellow; |Rate per
100,000
adults

scope=row style=background-color:yellow; |{{flaglist|Alabama}}

|| 99,800 || 2,640 || 60,700 || 1,610 || 40,900 || 1,080

scope=row style=background-color:yellow; |{{flaglist|Alaska}}

|| 12,900 || 2,320 || 8,400 || 1,520 || 4,400 || 800

scope=row style=background-color:yellow; |{{flaglist|Arizona}}

|| 137,500 || 2,570 || 84,800 || 1,590 || 55,000 || 1,030

class=wikitable - It could be expanded to add scopes to all header cells, including those spanning columns and rows (colspan and rowspan). And it could align row header text to the left as does class=plainrowheaders. The scopes would allow users of screen readers (the blind) to understand nearly all tables on Wikipedia, since nearly all use class=wikitable.

class=wikitable could also add a yellow or light yellow background to headers. That would solve {{u|Aréat}}'s problem with dark grey as a header background due to his visual impairment. It would help all readers. Highlighter felt-tip markers usually come in some shade of yellow. That is because this background color behind black text is one of the most legible color combinations.

class=plainrowheaders does not use bolded text in row headers. Many people do not like default bolded row headers. Especially in wide country lists, and other tables, where the width matters due to long country names, etc.. Also, people sometimes prefer to bold selected words or phrases in row headers.

----

Wikitext below is for the above yellow table if class=wikitable did scopes, color, and plain row headers. It's much simpler to edit by the average editor. Compressed horizontal format is more intuitive without all the inline CSS, etc..

class="wikitable sortable mw-datatable" style=text-align:right;

|+ Correctional supervision rates by state, 2016.

rowspan=2 |



Jurisdiction

! colspan=2 |Total

! colspan=2 |Community supervision

! colspan=2 |Incarcerated

Total,
12/31/2016

! Rate per
100,000
adults

! Probation
or Parole,
12/31/2016

! Rate per
100,000
adults

! In prison
or jail,
12/31/2016

! Rate per
100,000
adults

{{flaglist|Alabama}}

|| 99,800 || 2,640 || 60,700 || 1,610 || 40,900 || 1,080

{{flaglist|Alaska}}

|| 12,900 || 2,320 || 8,400 || 1,520 || 4,400 || 800

{{flaglist|Arizona}}

|| 137,500 || 2,570 || 84,800 || 1,590 || 55,000 || 1,030

Wikitext below is the actual wikitext for the above yellow table, and includes all the inline CSS, etc.:

class="wikitable sortable mw-datatable plainrowheaders" style=text-align:right;

|+ Correctional supervision rates by state, 2016.

scope=rowgroup rowspan=2 style=background-color:lightyellow; |



Jurisdiction

! scope=colgroup colspan=2 style=background-color:yellow; |Total

! scope=colgroup colspan=2 style=background-color:yellow; |Community supervision

! scope=colgroup colspan=2 style=background-color:yellow; |Incarcerated

scope=col style=background-color:yellow; |Total,
12/31/2016

! scope=col style=background-color:yellow; |Rate per
100,000
adults

! scope=col style=background-color:yellow; |Probation
or Parole,
12/31/2016

! scope=col style=background-color:yellow; |Rate per
100,000
adults

! scope=col style=background-color:yellow; |In prison
or jail,
12/31/2016

! scope=col style=background-color:yellow; |Rate per
100,000
adults

scope=row style=background-color:yellow; |{{flaglist|Alabama}}

|| 99,800 || 2,640 || 60,700 || 1,610 || 40,900 || 1,080

scope=row style=background-color:yellow; |{{flaglist|Alaska}}

|| 12,900 || 2,320 || 8,400 || 1,520 || 4,400 || 800

scope=row style=background-color:yellow; |{{flaglist|Arizona}}

|| 137,500 || 2,570 || 84,800 || 1,590 || 55,000 || 1,030