By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,144 Members | 1,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,144 IT Pros & Developers. It's quick & easy.

Doing a table in CSS

P: n/a
--
I am just beginning to get into CSS. I like to keep all
my html simple and generic looking.

I want to use a table, because I have, (gasp) tabular
data. I want it to look like a table. Not only that,
but I want it to look like a plain ordinary
uncomplicated vanilla table, to look like everyone
else's table.

Seems to me that the only reasonably easy way to do this
is to declare the style transitional, and use <TABLE >

Is there a better way?

--digsig
James A. Donald
6YeGpsZR+nOTh/cGwvITnSR3TdzclVpR0+pr3YYQdkG
I+ZMSazMMSKlfyX+QwvlSFcNl49Fafn5glRFYcFV
4SY3/GBXA3FTNgCjcJdokwMMCbs5dlavAIpG3504w
--
http://www.jim.com
Jul 21 '05 #1
Share this Question
Share on Google+
14 Replies


P: n/a
James A. Donald wrote:
--
I am just beginning to get into CSS. I like to keep all
my html simple and generic looking.

I want to use a table, because I have, (gasp) tabular
data. I want it to look like a table. Not only that,
but I want it to look like a plain ordinary
uncomplicated vanilla table, to look like everyone
else's table.

Seems to me that the only reasonably easy way to do this
is to declare the style transitional, and use <TABLE >

Is there a better way?

--digsig


Since you have tabular data, I'd go with a table, that's what they're for.

============================

http://www.allmyfaqs.com/faq.pl?Tableless_layouts

CSS-Based Layouts

HTML was never designed to be a layout language. The <table> element was
designed to mark-up tabular data (such as you'd find in a spreadsheet).
CSS (Cascading Style Sheets) was designed for design and presentational
issues - and makes pages easier and faster to code, more manageable,
accessible, and faster to download.

Do not let the term "tableless layouts" fool you, it means exactly what
it says, it does not mean "tableless webpages". You should continue to
use tables for tabular data.

============================

http://webdesign.about.com/od/css/a/aa102102a.htm

....CSS Positioning (CSS-P) is the only way to create standards based Web
pages using XHTML. Why? Because XHTML requires that tables only be used
to define tabular data, and not be used for layout.

============================

http://www.tableless.com.br/en/

What is Tableless?

Tableless isn't a technology, nor a programming language, much less an
application! Tableless is a rather misleading name for a method of
building clean, accessible and standard complaint websites.
Notwithstanding, "tableless" is what best describes the main concept
towards a more accessible web: the abolishing of tables as a means of
designing web sites.

We use CSS to format the information contained in the text markup files
or, if you prefer, (X)HTML files.

Clarifying: We don't use the infamous tables to structure the website.
For this we use exclusively CSS. We didn't get rid of the tables. In the
tableless method, all the tags are used semantially, i.e, each tag has
its own role. If you want to have an italic text, you should use the
<i></i> tag. Want a paragraph? Use <p></p> Got it? So, if you want to
display tabular data , e.g. a list of products with their prices, names,
if it's available in the stock; you should use tables. Therefore, using
tables to display tabular data is right but never use them to layout
structuring.

============================

http://www.dcddesigns.com/folder/web...esign-Services

Tableless CSS Driven "Fluid" Website Design

So you may be asking "what are tables and why does removing them from my
website help?" Glad you asked! Tables have mistakenly been used for many
years by designers to piece a site's graphic layout back together,
similar to a jigsaw puzzle.

.... Removing tables from non-tabular data will also allow those with
disabilites and image disabled browsers a more meaningful experience
with your website and as more and more non computer devices are able to
access websites your site will be ready to go on them!
Jul 21 '05 #2

P: n/a
James A. Donald wrote:
--
I am just beginning to get into CSS. I like to keep all
my html simple and generic looking.

I want to use a table, because I have, (gasp) tabular
data. I want it to look like a table. Not only that,
but I want it to look like a plain ordinary
uncomplicated vanilla table, to look like everyone
else's table.

Seems to me that the only reasonably easy way to do this
is to declare the style transitional, and use <TABLE >

Is there a better way?


Yes, there is a better way. Use strict instead of transitional: TABLE
is not deprecated, just misused.
Jul 21 '05 #3

P: n/a
On Mon, 30 May 2005 17:02:21 -0700, James A. Donald
<ja****@echeque.com> wrote:
I want to use a table, because I have, (gasp) tabular
data. I want it to look like a table. Not only that,
but I want it to look like a plain ordinary
uncomplicated vanilla table, to look like everyone
else's table.

Seems to me that the only reasonably easy way to do this
is to declare the style transitional, and use <TABLE >

Is there a better way?


Yes: declare it _strict_, and use a <table>.

The idea that "you mustn't use tables" is an oversimplification. Not
even the most thoroughgoing purist would object to using <table> for
data that are actually tabular by nature. The objection is to using
<table> simply to enforce a layout -- _that_ is what should better
be done with CSS.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
"I feel a wave of morning sickness coming on, and I want to
be standing on your mother's grave when it hits."
Jul 21 '05 #4

P: n/a
"C A Upsdell" <""cupsdellXXX\"@-@-@XXXupsdell.com"> escribió en el mensaje
news:V7********************@rogers.com...
James A. Donald wrote:
--
I am just beginning to get into CSS. I like to keep all
my html simple and generic looking.

I want to use a table, because I have, (gasp) tabular
data. I want it to look like a table. Not only that,
but I want it to look like a plain ordinary
uncomplicated vanilla table, to look like everyone
else's table.

Seems to me that the only reasonably easy way to do this
is to declare the style transitional, and use <TABLE >

Is there a better way?


Yes, there is a better way. Use strict instead of transitional: TABLE is
not deprecated, just misused.

there's nothing wrong with <table> if you have tabular data.
the use of <table> is not recommended when it comes to
layout design.
Jul 21 '05 #5

P: n/a
SorbitoL wrote:
Yes, there is a better way. Use strict instead of transitional: TABLE is
not deprecated, just misused.


there's nothing wrong with <table> if you have tabular data.
the use of <table> is not recommended when it comes to
layout design.


What else did you think I meant?
Jul 21 '05 #6

P: n/a
C A Upsdell
Use strict instead of transitional: TABLE
is not deprecated, just misused.


When I use "strict" I get the error messages such as
: : Line 46, column 12: there is no attribute "WIDTH"
: : <TD width="47%">

Doubtless there is a CSS equivalent of WIDTH and I should know it, but
I cannot seem to find any examples of tables done under strict. There
is a web page that seems to be about tables done under strict,
http://www.w3.org/TR/REC-CSS2/tables.html but without any examples, I
find the web page mystifying and overwhelming.

That web page tells me there is such a thing as a width property, yet
I get error messages about that property when I use the W3C Markup
Validation Service


--
http://www.jim.com
Jul 21 '05 #7

P: n/a
James A. Donald <ja****@echeque.com> wrote:
When I use "strict" I get the error messages such as
: : Line 46, column 12: there is no attribute "WIDTH"
: : <TD width="47%">

Doubtless there is a CSS equivalent of WIDTH
Called "width", difficult eh?
and I should know it, but
I cannot seem to find any examples of tables done under strict. There
is a web page that seems to be about tables done under strict,
http://www.w3.org/TR/REC-CSS2/tables.html
That explain the CSS table model, use the HTML spec:
http://www.w3.org/TR/html4/struct/tables.html
but without any examples, I
find the web page mystifying and overwhelming.

That web page tells me there is such a thing as a width property, yet
I get error messages about that property when I use the W3C Markup
Validation Service


The width attribute has been deprecated for table cells, but not for
other elements such as table. Deprecated means that it's not valid under
the Strict DTD. http://www.w3.org/TR/html4/index/attributes.html

The reason why certain seemingly presentational attributes such as
valign are still valid under the Strict DTD is that in certain
situations moving them to css could result in a loss of structure which
can negatively effect the user's ability to interpret the content.

--
Spartanicus
Jul 21 '05 #8

P: n/a
On Tue, 31 May 2005 21:33:14 -0700, James A. Donald
<ja****@echeque.com> wrote:
C A Upsdell
Use strict instead of transitional: TABLE
is not deprecated, just misused.
When I use "strict" I get the error messages such as
: : Line 46, column 12: there is no attribute "WIDTH"
: : <TD width="47%">

they are probably telling you in strict there is no inline style, so
no width inline
try defining width up in the head then move it to separate style
sheetDoubtless there is a CSS equivalent of WIDTH and I should know it, but
I cannot seem to find any examples of tables done under strict. There
is a web page that seems to be about tables done under strict,
http://www.w3.org/TR/REC-CSS2/tables.html but without any examples, I
find the web page mystifying and overwhelming.

http://www.sturgood.com/dna/result/
in this example I group floating tables inside separate divs. valid
strict html and css.
I define no width on the tables or divs though to allow for
flexibility. For people like me there is finally the ability to
increase the font size to read tabular data.

cheers
johnSteve

Jul 21 '05 #9

P: n/a
"Spartanicus" <in*****@invalid.invalid> wrote in message
news:dh********************************@news.spart anicus.utvinternet.ie...
James A. Donald <ja****@echeque.com> wrote:
That web page tells me there is such a thing as a width property, yet
I get error messages about that property when I use the W3C Markup
Validation Service


The width attribute has been deprecated for table cells, but not for
other elements such as table. Deprecated means that it's not valid under
the Strict DTD. http://www.w3.org/TR/html4/index/attributes.html


That would be in regard to attributes in the manner of <td width="10%">, as
opposed to <td style="width:10%">, right?
Jul 21 '05 #10

P: n/a
"Tony" <so*****@somewhere.not> wrote:
The width attribute has been deprecated for table cells, but not for
other elements such as table. Deprecated means that it's not valid under
the Strict DTD. http://www.w3.org/TR/html4/index/attributes.html


That would be in regard to attributes in the manner of <td width="10%">, as
opposed to <td style="width:10%">, right?


Correct. In the latter example "style" is the attribute, "width" is the
property of a css rule, with "10%" as it's value.

Note that using inline css such as in the latter example is rarely good
practice.

--
Spartanicus
Jul 21 '05 #11

P: n/a
"Spartanicus" <in*****@invalid.invalid> wrote in message
news:o0********************************@news.spart anicus.utvinternet.ie...
"Tony" <so*****@somewhere.not> wrote:
The width attribute has been deprecated for table cells, but not for
other elements such as table. Deprecated means that it's not valid under
the Strict DTD. http://www.w3.org/TR/html4/index/attributes.html
That would be in regard to attributes in the manner of <td width="10%">,
as
opposed to <td style="width:10%">, right?


Correct. In the latter example "style" is the attribute, "width" is the
property of a css rule, with "10%" as it's value.


That's what i thought.
Note that using inline css such as in the latter example is rarely good
practice.


Was mainly doing it to make the difference clear
Jul 21 '05 #12

P: n/a
James A. Donald
When I use "strict" I get the error messages such as
: : Line 46, column 12: there is no attribute "WIDTH"
: : <TD width="47%">

johnSteve they are probably telling you in strict there is no inline style, so
no width inline
try defining width up in the head then move it to separate style
sheet
What I have done is moved the width attribute to a <COL width=47%><COL
width=53%>, inside the <TABLE></TABLE> but above the <TR></TR>

This fixed the problem, works in strict, and seems a lot better than
the old way (since table formatting code should not have to look
ahead)

Obviously the truly correct thing to do is to create a style sheet
with various table styles corresponding to tables with different <COL>
attributes, effectively moving the <COL> attributes to a style sheet.

Not clear to me how to move the <COL> data into a style sheet. Cannot
seem to find any examples.
http://www.sturgood.com/dna/result/
in this example I group floating tables inside separate divs. valid
strict html and css.
I define no width on the tables or divs though to allow for
flexibility. For people like me there is finally the ability to
increase the font size to read tabular data.


You have moved your <table> properties into the <STYLE> command and
similarly for your <TD> properties, but no column width properties. I
would expect them to go into a table class.

I attempted to move my now working table attributes into a style
command

<STYLE type=text/css>{
}
TABLE {
BORDER:1; WIDTH:100%;
<COL width="34%"><COL width="66%">
}
</STYLE>

The parser was happy with it, but the output was total crap. No
borders, and the first table the first column was 66% and the second
34%, and in the next table the other way around

--
http://www.jim.com
Jul 21 '05 #13

P: n/a
On Wed, 01 Jun 2005 10:56:42 -0600, johnSteve <st****@bresnan.net>
wrote:
they are probably telling you in strict there is no inline style, so
no width inline


Huh? Inline styles are just fine in HTML 4.01 Strict.

For <td> in particular, refer to
http://www.w3.org/TR/html401/struct/....html#h-11.2.6
and note that core attributes are allowed. Core attributes are
defined at
http://www.w3.org/TR/html401/sgml/dtd.html#coreattrs
and include style.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
"I feel a wave of morning sickness coming on, and I want to
be standing on your mother's grave when it hits."
Jul 21 '05 #14

P: n/a
Gee Im honored Ive been quoted here (found it in my copyscape) but
everything I said in that article on my site is 100% and if you care at
all about your SE rankings you'll learn tableless layouts and fast! Man
your rankings can go through the roof!

If you want a great place to learn this stuff Im a member of
sitepoint.com ... some of the best CSS gurus in the world over there
will help you work thru the hard times you'll have switching. It sucks
at first but one you learn it you wonder why you ever used tables for
non tabular data!

thanks again for the quote!

Jul 21 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.