473,320 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Add text to header cell

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
span.numerino
{
position:relative;
top:0;
left:-5;
padding:0;
margin:0;
float:left;
border: 0px solid gray;
text-align:left;
font-size:smaller;
}
// 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">
<TR>
<TH scope="col" abbr="Name">
<span
style="position:relative;top:0;left:-5;padding:0;margin:0;float:left;border:
0px solid
gray;text-align:left;z-index:2;font-size:smaller;">1</span>Course
Name</TH>
<TH scope="col" abbr="Tutor">
<span
style="position:relative;top:0;left:-5;padding:0;margin:0;float:left;border:
0px solid
gray;text-align:left;z-index:2;font-size:smaller;">2</span>Course
Tutor</TH>
<TH scope="col">
<span
style="position:relative;top:0;left:-5;padding:0;margin:0;float:left;border:
0px solid
gray;text-align:left;z-index:2;font-size:smaller;">3</span>Summary</TH>
<TH scope="col">
<span
style="position:relative;top:0;left:-5;padding:0;margin:0;float:left;border:
0px solid
gray;text-align:left;z-index:2;font-size:smaller;">4</span>Code</TH>
<TH scope="col">
<span
style="position:relative;top:0;left:-5;padding:0;margin:0;float:left;border:
0px solid
gray;text-align:left;z-index:2;font-size:smaller;">5</span>Fee</TH>
</TR>
</table>

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.

Sep 5 '05 #1
1 2313
Basso wrote:
Hello, I'd like to add a progressive number to upper-left corner on
every TH element avoiding cell text reposition.
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.
<TH scope="col" abbr="Name">
<span
style="position:relative;top:0;left:-5;padding:0;margin:0;float:left;border:
0px solid
gray;text-align:left;z-index:2;font-size:smaller;">1</span>Course
Name</TH>
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.
This piece of code works but my idea is to place this number on cell
without text repositioning (and this doesn't work)


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.)
Sep 5 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Roy Riddex | last post by:
I have a text file which holds data for 30 cars in the following way: CarRegistration CarType CarClass Available I'm trying to display the full contents of this...
5
by: objectref | last post by:
Hi to all, i populate a ListView with data from a datareader and i just want to know the column name of the cell that the user clicks on. E.x., if the user clicks on the 2nd column, 3rd row in...
10
by: MSNews | last post by:
Hi. I need to set texts to the row headers of a Datagridview, like we can do with column headers. For example: ======================================== | COLUMN A | COLUMN B | COLUMN B |...
3
by: smHaig | last post by:
I have a page using a master page the master page consists of a header and left column table template. In the content area of the default page, I need to place alot of text. I initially had a...
2
by: carolyn | last post by:
A hopefully quick question... I would like to position a graphic in a header bar so that: - the image is on the left end, centred vertically. - the text is centred horizontally, and when...
8
by: fredd00 | last post by:
hi i'm trying to change the gridview columns header text the columns are not auto generated, i have set specific headertext values for each column i want to change the header text based on...
1
by: dana2002 | last post by:
Hi All; I want to use loop to find a specific text ( Drawing Name) in an excel range, make that cell active, copy the data from the cell in the column accross from the cell containning the (...
1
by: DaveyP | last post by:
I have a user control (called data_dictionary) which I need to add into the header text of a datagrid. I'm doing this by adding the control in the RowCreated event as follows: dds_descriptions...
2
by: ravir81 | last post by:
Hi, I am working on excel reporting using Perl. I am facing problem with writing the header part only once for all the excels created using Perl. Here is the code : ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.