Click to See Complete Forum and Search --> : How I can place an element in top position inside cell of table with CSS or HTML?


ptik
02-20-2003, 04:18 AM
How I can place an element (for example, text) in top position
inside cell of table with CSS or HTML?

Stefan
02-20-2003, 04:38 AM
<td style="vertical-align:top">text</td>

However it sounds like you might be abusing <table> to create general page layout. If that's the case you should look into getting rid of the table entirely and use CSS for your layout.

PeOfEo
02-20-2003, 11:27 AM
In html you can actually put a table inside of another table so when you have a large table for your layout you can position smaller things within another table inside of it.

spufi
02-20-2003, 01:11 PM
And that's the exact thing Stefan just spoke out against using. Been there, done that, please don't make me go back. :D

nkaisare
02-20-2003, 02:16 PM
[QUOTE]Originally posted by PeOfEo
[QUOTE]
Think outside the box... um... tables. If you are using tables to get nice layout, you may want to look into CSS. Its better, more flexible and will turn out to be an easier way, in the long run.

Simple tutorial for using CSS for layouts may be found at
http://www.thenoodleincident.com/tutorials/box_lesson/boxes.html

For general reference/tutorial on CSS, you may visit http://w3schools.com

PeOfEo
02-22-2003, 01:33 AM
Im going to be conservative on this one. I am used to tables. I am well aware of what css can do and I think tables the way to go.

Stefan
02-23-2003, 05:31 AM
Originally posted by PeOfEo
Im going to be conservative on this one. I am used to tables. I am well aware of what css can do and I think tables the way to go.

NP, some of us take longer to make the switch :)
See you in the CSS forum in a year or two :)

PeOfEo
02-23-2003, 02:38 PM
I alredy use css a lot. For text box colors borders scroll bars link affects, etc. I just dont want to use it for layout. I think tables do a good job, just as good of a job as css

DUMD-DO
02-27-2003, 07:52 PM
I must be a idiot but I like using both CSS with Tables for one fact "that browsers that don't support CSS, the page can still be viewed by older browsers". Until all browsers support CSS this is my thoughts.

In the table use the align, hsalign, and valign
In CSS use the code provided by Stephan with the proper containers.

nkaisare
02-27-2003, 08:09 PM
Apart from NS4.7, all other browsers do more than decent job on CSS. We do complain about MS and Opera and so forth. But those problems are not at all unworkaroundable (un-work-around-able:)).

The only real cross-browser problem is when you nest relative positioned element within an absolute div. And ofcourse {left: auto; right: auto} doesn't center things the way its supposed to.

But really, these are just excuses instead of the face: we have the inertia but are not bold enough to admit it.

(BTW, my own homepage uses tables for layout... although NS4.7 is the reason I cite, deep in my heart, i know that the reason is inertia... i am just too lazy to do that any time soon)

Stefan
03-01-2003, 03:40 PM
Originally posted by DUMD-DO
[B]Until all browsers support CSS this is my thoughts.


And what about the browsers that don't support tables? Do you ever consider them and how an ill consived table layout can compleatly mess upp a page in them?

100% support in all browsers for everything is virtualy unheard of. Basicly all CSS capable browsers are good enough to do a basic "table" layout with eg 3 columns, EVEN NS 4.x
However NS 4 is so buggy that half of the development time will be spent on trying to work around it's various bugs, so most large sites that today uses CSS simply treat NS 4.x as a less or non CSS capable browser.
That IMO is a much better approach then trying to hide behind the 1% NS 4 userbase as an excuse for keeping nested table layouts.

khaki
03-02-2003, 12:57 PM
PeOfEo wrote:
In html you can actually put a table inside of another table so when you have a large table for your layout you can position smaller things within another table inside of it.

I still use tables (when necessary) and it's much easier to nest tables using CSS than to nest tables inside of other tables.

And aside from the many extra lines of script that is required for the "container/layout" tables, it's also a bear to debug at a later date.

I say... use tables... but use them with CSS.
The table is fine for presenting data.
But CSS is ideal for layout/positioning.
It's a beautiful thing!
k