SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)

    abbr attribute in tables

    Ah, question:
    I'm reading http://www.w3.org/TR/html401/struct/...html#adef-abbr and http://www.w3.org/TR/2005/WD-WCAG20-...atatables_abbr and wonder about going the other way around.

    In small tables like Calendars, you use abbreviations in the first place, because there simply isn't room to use the full words. I thought abbr could be used to make the full word be spoken for AT instead of sounding weird.

    Example:
    Code:
    <table>
      <thead>
        <tr>
          <th colspan="7" scope="colgroup">november 2010</th>
        </tr>
        <tr>
          <th abbr="zondag" scope="col">zo</th>
          <th abbr="mandag" scope="col">ma</th>
          <th abbr="dinsdag" scope="col">di</th>
          <th abbr="woensdag" scope="col">wo</th>
          <th abbr="donderdag" scope="col">do</th>
          <th abbr="vrijdag" scope="col">vr</th>
          <th abbr="zaterdag" scope="col">za</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td></td>
          <td>1</td>
          <td>2</td>
          <td>3</td>
          <td>4</td>
          <td>5</td>
          <td>6</td>
        </tr>
    ...etc
      </tbody>
    </table>
    So in order to get "Monday 1" instead of "ma 1" I've got abbr. What comes to mind:
    The first time through, the actual th is (may be, depends on reader/settings) read out, and then the abbr versions. Defeats the purpose.
    Second, I'm assuming there's a visual precedent (there is) but not an audio precedent (I don't know if people are used to "wo" as meaning "woensdag" (wednesday)).

    I'm wondering if there's any discussion or precedent of using abbr (or something else) for tables who have the opposite-from-usual problem: the headers are already shortened, and the full meaning should be spoken at least the first time.

    There is mention of other-way-around in the W3C specs:
    User agents must render either the contents of the cell or the value of the abbr attribute. For visual media, the latter may be appropriate when there is insufficient space to render the full contents of the cell.
    On WCAG, the assumption is the header may be too long, and repeated listening of a long header is not desirable, so the abbr text can be read out instead (after at least one instance of the full header being read out).

  2. #2
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not use the <abbr> element?
    Code:
    <th><abbr title="Monday">Mo</abbr></th>
    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials

  3. #3
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    Because those are not guaranteed to read anything out in AT... so far as I know, abbr attribute in tables have a higher read rate since they were created most specifically for screen readers.

    Definitely a title attribute isn't going to read out when you're at the bottom of the table (if you're going for column-header read out right before data-cell info).

  4. #4
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, I seriously misunderstood your problem.

    I suppose
    HTML Code:
    <th>Mo<span>nday</span></th>
    would cause an ugly butchering of the word? Where th span {display: none;}.

    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials

  5. #5
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    Hm.

    No, that's a convoluted but interesting idea. Not display: none there of course (otherwise you're still getting "mo" read out) but off screen could work. It does assume your abbreviation is the first part of the word though.

    Could also work for when you have "price" as the shortened header and visually it's obvious that it's "price per widget" or something, so visually you only need "price" but you want "price per widget" read out at least once. Abbr does this the other way:
    If you have
    <th scope="col" abbr="price">Price per widget</th>
    Here first time around you get "price per widget" but repeated readings give you the more desirable "price". See example with "Type" on W3C page.

    I'm just wondering if it's also meant for the other way around... something beyond the single cryptic sentence on the W3C page.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •