CSS table don't look like html TABLE

V

vitay

Hi

I have table in HTML that look like:

example1
col1 col2
|text_short |text2|
|text_longgggg|text2|

example2 (the same table but text_long is longer)
col1 col2
|text_short |text2|
|text_longggggggg|text2|

I have in div CSS effect like this

col1 col2
|text_short|text2|
|text_longggggggg|text2|

This is a bad effect for me!!
And how to do in CSS like true table HTML?
 
B

Bergamot

vitay said:
And how to do in CSS like true table HTML?

If the data is tabular, then use a table - that's what it's for.
If the data is not tabular, then post a URL so we can better understand
the actual situation. Do not post code, please.
 
V

vitay

And how to do in CSS like true table HTML?
If the data is tabular, then use a table - that's what it's for.
If the data is not tabular, then post a URL so we can better understand
the actual situation. Do not post code, please.
I think is this possible to do with CSS completely like table.
Table have width auto and if for example if first col of first row
have 200px then table automatic do with all cols in another rows of table.
Div is like others rows not connected each other.
 
B

Bergamot

vitay said:
I think is this possible to do with CSS completely like table.
Table have width auto and if for example if first col of first row

I think you missed the point - if you're talking rows and columns, it
sounds like tabular data.

Use the right tool for the job. For tabular data, that means HTML
tables. CSS is the wrong tool.

If the data is not tabular, then rows and columns have no meaning. You
probably don't have the document structured properly to get the results
you want. Post a URL and someone can point you in the right direction
for your particular content.
 
D

dorayme

Bergamot said:
If the data is not tabular, then rows and columns have no meaning.

I have dreams about this statement. I think of the search for
meaning in the meaningless, I think of the clear meaning of
columns that contain navigation and yet are considered
meaningless by the priests. I see hidden meaning where the
priests don't. I am halfway to hell.
 
S

Stan McCann

I think you missed the point - if you're talking rows and columns, it
sounds like tabular data.

Use the right tool for the job. For tabular data, that means HTML
tables. CSS is the wrong tool.

You are incorrect with this statement and your statement shows a lack
of understanding as to the difference between HTML and CSS. Of course,
you want to use HTML tables for tabular data, but then if you wish your
table to look a certain way, you should use CSS to style the table to
look as you want just as you would with any paragraph, div, or
whatever.

You may be confusing the tables for layout argument in your above
statement. HTML is the right tool for the job of marking up a page.
CSS is the right tool for the job of styling the HTML.

Someone probably has already, but what the OP wants is possibly
something like this for his CSS:

table{ border:thin solid black }
td { border:thin solid black }

Maybe adding some attributes to the td such as:

td{ border:thin solid black; border-collapse:collapse;
empty-cells:show }
 
D

Dylan Parry

Stan said:
Someone probably has already, but what the OP wants is possibly
something like this for his CSS:
[...]

That might be so, but without a URL we can but rely on our crystal balls
and tea leaves. In many cases, as with this one, the question is so
ambiguous that any answer will be a stab in the dark at best, and a stab
in the back at worst.

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

Programming, n: A pastime similar to banging one's head
against a wall, but with fewer opportunities for reward.
 
B

Bergamot

Stan said:
You are incorrect with this statement and your statement shows a lack
of understanding as to the difference between HTML and CSS.

I am fully aware of the differences. My point was that laying out
tabular data with CSS instead of HTML tables is the wrong way to go.
From his example, that's what it appeared he was trying to do.
what the OP wants is possibly...

As Mr Parry says, what the OP wants is a shot in the dark, since he has
not provided enough info to give a solid answer. I requested a URL so
we'd know better what he has, thus what direction to go. That's better
than guessing without sufficient info, don't you think? ;)
 
S

Stan McCann

I am fully aware of the differences. My point was that laying out
tabular data with CSS instead of HTML tables is the wrong way to go.
From his example, that's what it appeared he was trying to do.

You might should have worded your statement differently. The way it
was worded shows a misunderstanding of HTML and CSS. Since you meant
that tables should not be used for layout, you could have said so
eliminating misunderstandings such as mine.
As Mr Parry says, what the OP wants is a shot in the dark, since he
has not provided enough info to give a solid answer. I requested a
URL so we'd know better what he has, thus what direction to go.
That's better than guessing without sufficient info, don't you
think? ;)

You are both correct here. I ASSumed from his example using
"borders," the characters between cells. I also ASSumed because I've
seen the "how do I make tables with borders using CSS?" so often. I
know better than to assume making an ass of myself too.</head hung in
shame> ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top