Add text to header cell

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hello, I'd like to add a progressive number to upper-left corner on
every TH element avoiding cell text reposition.

// TH props
table.quadroData th
    text-align: center;
    background-color: #C6DEF0;
    border-color: #E5F5FF;
text is vertically centered.

// progressive number props
    border: 0px solid gray;

// A part of my HTML
<TABLE border="1" cellpadding="5" cellspacing="1"
  summary="History courses offered in the community of
           Bath arranged by course name, tutor, summary,
           code, and fee">
    <TH scope="col" abbr="Name">
0px solid
    <TH scope="col" abbr="Tutor">
0px solid
    <TH scope="col">
0px solid
    <TH scope="col">
0px solid
    <TH scope="col">
0px solid

This piece of code works but my idea is to place this number on cell
without text repositioning (and this doesn't work)

Thanks for help, Luca.

Re: Add text to header cell

Basso wrote:

Quoted text here. Click to load it

I'm not sure I see what you try to accomplish. As usual, a URL would be
worth more than a kibioctet of code snippets.

Besides, it seems that your current approach uses CSS, not HTML, and
uses syntactically malformed CSS at that (a declaration like left: -5
shall be ignored by a conforming browser). CSS belongs to our sister
group c.i.w.a.stylesheets.

Quoted text here. Click to load it

When CSS is disabled, this results in <th>1Course Name</th>. It's
probably better to insert a space after the number. (Makes the page
better food for search engines, too.) You can always use a little bit of
CSS to suggest the more exact amount of spacing.

Quoted text here. Click to load it

Have you considered <th><sup>1</sup> Course Name</th>, perhaps combined
with a style sheet that suggests suitable rendering details for any
<sup> contained in a <th>? (You would probably not even need class
attributes, since you hardly have <sup> for other purposes inside <th>.)

(In theory, you could alternatively use the _characters_ superscript
one, superscript two, etc., but then you would need some markup anyway
to make them elements, for styling purposes, and browser support to
superscript digit characters falls drastically after superscript three.)

Site Timeline