Tables with fixed columns

How do I create a Fixed Column using a Table?I need
the fixed Column to contain some key field, which can
always be viewed while scrolling through the other
Who is Participating?

Improve company productivity with a Business Account.Sign Up

johnny99Connect With a Mentor Commented:
anupdn, I'm sorry to have to tell you, I don't think anyone understands your question, which is why you keep getting unsatisfactory answers.

Please tell us what you want in more detail, with examples.

*My* interpretation of what you want is that you want the "fixed" column to contain some sort of generic information like:


and the other columns to contain the details of a number of different records, for instance

Name:    Fred
Address: Elm Street
Number:  555-1234

And in some way you want to be able to scroll one record (3 lines) at a time, i.e. you want to be able to scroll in one click from the above to:

Name:    Bob
Address: Oak Street
Number:  555-4321

(This is the effect you can get in Excel by splitting the screen, for instance)

If that's what you want, then we can all go home, because it's simply not possible. Tables don't scroll, only windows and frames scroll, and you can't control the scrolling of frames in any way that will force the name to line up against "Name:" and the address to line up against "Address:" etc.

The only way to achieve this effect would be having each person's record as a separate HTML document.  Then rather than scrolling, you could link each record to the next and make the new record load into the frame when you went from Fred to Bob. I can't see any other way.
use a frame
sybe, You need to post that as an answer :-)

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to and use offer code ‘EXPERTS’ to get 10% off your first purchase.

anupdnAuthor Commented:
If I do add frames How can I maintain a link between the tables in both the frames, so as to scroll vertically. I mean if at all there are more then screen ful of rows, I need to scroll vertically which means both my frames/tables should be in sync.
How do I do this?This is in fact one thing I had tried out, but it fails when I want to scroll vertically!!!
Then use layers, that affect each other when nesesary. be ware, this only works in NN>=4 and IE>=4.
Frames can be done, but what you are asking is very integrated. DHTML will offer some solutions, but you will not be able to see this stuff in other browsers.

I have a friend that had another ingenious idea that worked pretty good. This was for an intranet site, so I don't have an address, if that page is still being used.

He created a picture that would become the background image on the chart. The Table was placed around that picture. He gave it a great effect by watermarking the background.

So If you need a 'fixed column, you have some options. Just remember, the cooler the option, the more complicated it is...
I may not have got the question correctly but all you wanted to know is how to make a column in a table fixed?  Why not just use fixed width as opposed to variable % widths.
use Perl can help you. Every output can be control by fixed format, very easy.

DEVELOPMENT, the way I read ANUPDN's question is that he/she
has data like:
 Beatles: John, Paul, George, Ringo
 Stones: Mick, Keith
and wants output in a table like:

Beatles  John
Beatles  Paul
Beatles  George
Beatles  Ringo
Stones   Mick
Stones   Keith

i.e., the first column changes "slowly",
while the second column changes for every row.

A background-image won't help.
The generated HTML will have to "distribute" the data
over the appropriate rows.
The only way for this to work with ALL browsers and not only IE4/or NN4 is to split your table.
Be aware that while there is no problem in scrolling VERTICALLY it is considered VERY ANNOYING for a user to scroll HORIZONTALLY.
Just split your table and put the freezed column/s first- there is no other way.
anupdnAuthor Commented:
I have already tried this solution, which I had already commented on.It is indeed a problem scrolling horizontally.I am sorry that I have to reject this solution.
I want a generic solution, which can work in Netscape and in IE.

JOHNNY99 wrote:
> I don't think anyone understands your question,

Did you read the comment by OTTA ?
It was quite similar to your understanding of ANUPDN's question.
Yes, Otta, I did read it, but I think my interpretation is different enough to be worth posting, but I think the important thing is that anupdn spells out exactly what he or she wants -- so many of the questions on Experts-Exchange are like this: "I want to do [blah]", but they don't know how to put blah into words... I guess if they did, then they wouldn't have to ask...
anupdnAuthor Commented:
I am sorry to tell you this, but I think you making a big mess of very shraight forward question.
I will try to give you more examples.
Suppose I have 15 columns in a table.The first Column contains the description field.Now it's quite obvious that when you talking of 15 columns, you cannot view all the 15 columns in one shot on the screen.
Now here's the catch. Suppose I want to view the 15th column, I would scoll vertically to the column, which means that my first column is no more visible to me !
Thats why when I scroll to the 15th column , I need to see the first column, which means I have to keep the first column as fixed.

If you have ever worked in VB, you must have observed how the Microsoft Grid works when you say that you want a row as fixed !

Hope this is a better way to present my problem.I know that it cannot be done in one single Table.There should be an alternate way of doing this.A round about way of doing it.

I nearly solved it when I used frames.But it's a pain when the person has to scroll horzontally.

Er, well, you've accepted my answer, so I guess it's over.
What you described is basically what I guessed you meant, but still I don't understand what you mean.

"Column" to me means a vertical series of items. Therefore if you have fifteen columns, you would have to scroll horizontally to go to from 1 to 15. You're either confused between column and row or you're confused between horizontal and vertical!

I have no intention of ever working in VB, nor do I know or care what Microsoft Grid might be. : )

Two things:

* "it's quite obvious that when you talking of 15 columns, you cannot view all the 15 columns in one shot on the screen" er, not to me, because it depends on the size of the screen and the width of the columns

* you seem to be hung up on the idea that a user shouldn't have to scroll horizontally -- I don't think it's a problem, and if it is, why don't you just reorient your table so that they scroll vertically?

As an HTML question, this one has been answered long ago. How can you create a table with a fixed column? You can't.
anupdnAuthor Commented:
Dear johnny99,
I know very well that tables can't have fixed columns.But there are lot more things which are not directly possible in HTML.But still there are ways and means to make it happen.

I am sorry that I made a mistake when saying that that 'to view the 15th column we have to scroll vertically' it should have been

Finally I never told you to work in VB and for the matter know what's a Microsoft grid is !!!I just wanted  to know if you had previously worked in VB, so as to give you a better perspective!

I am also sorry to tell you that no one has given me a right soultion.I will surely post the solution once I come across one!!!

Anyhow thanks for your 'response'.
Are we having a fight now?

I think you're mistaken. You've already got the answer. The thing you want to do is going to be done with frames or not at all, so you should give someone the points -- I'm not saying it should be me, I don't care, but you're making assumptions about HTML that are causing you to waste lots of time. You're mapping ideas about other languages and protocols onto HTML and they just don't fit.

  >  I know very well that tables can't have fixed columns.

Er, not when you first asked the question.

  >  But there are lot more things which are not directly
  >  possible in HTML

No idea what you mean. A thing is either possible in HTML or it isn't.

  >  But still there are ways and means to make it happen.

Good luck!
anupdnAuthor Commented:
I am Sorry, I am not fighting anyone nor I intend to do so. I just wanted a solution which, (let me put it this way) can solve this problem 'logically', if not 'directly', just like you and others correctly figured out the usage of frames or by splitting the table.These are not direct ways, I mean these are some of the 'creative' approaches for this problem, which too, I am afraid, has loopholes !
> but you're making assumptions about HTML that are causing you to waste lots of time

Thanks for your advise. In fact I did waste some time on this, but it was very important for me then.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.