473,406 Members | 2,707 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,406 software developers and data experts.

How to set up a Table

Hi there

I have one table. It is called links and looks like this:

<table id="links">
<!-- loop -->
<tr>
<td width="50%">item 1</td>
<td width="50%">item 2</td>
</tr>
<!-- end loop -->
</table>

(the items comes from a database and this loop goes on as long as data
is available)
------------------

For the stylesheet i have:

table#links {
width:505px;
margin:20px 20px 0px 40px;
}

tr#links {

}

table#links td{
width:50%
font-family: arial, verdana ,sans-serif;
font-size:80%;
margin:0;
font-weight:normal;
line-height:170%;
color:#0066CC;
}

table#links a:link {
color: #0066CC;
text-decoration: normal;
}

table#links a:visited {
color: #062D51;
text-decoration: normal;
}

table#links a:hover {
color: #0066CC;
text-decoration: normal;
}

Okay, this works alright :)

My question is only if this is correct CSS. It validates alright, but i
am a bit confused over this part:

table#links

Is this the only way to describe my table or is there a better way?

Mark

Aug 18 '05 #1
2 1588
Mark schreef:
My question is only if this is correct CSS. It validates alright, but i
am a bit confused over this part:

table#links

Is this the only way to describe my table or is there a better way?

Mark

It's the best way to do that, it looks good, just a few minor 'errors':

1. In the HTML, you can delete the width="50%" part:
<table id="links">
<!-- loop -->
<tr><td>item 1</td><td>item 2</td></tr>
<!-- end loop -->
</table>

2. In the table#links td-part you forgot the ; at the end of width:50%
table#links td{
width:50%;

3. The part: tr#links {} must be: table#links tr {}
But it's emty so that doesn't matter

--
Niek
Aug 18 '05 #2
'sNiek wrote:
Mark schreef:
My question is only if this is correct CSS. It validates alright, but
i am a bit confused over this part:

table#links

Is this the only way to describe my table or is there a better way?

Mark

It's the best way to do that, it looks good, just a few minor 'errors':

1. In the HTML, you can delete the width="50%" part:
<table id="links">
<!-- loop -->
<tr><td>item 1</td><td>item 2</td></tr>
<!-- end loop -->
</table>

2. In the table#links td-part you forgot the ; at the end of width:50%
table#links td{
width:50%;

3. The part: tr#links {} must be: table#links tr {}
But it's emty so that doesn't matter


:) Ok, thanks a lot!

Mark

Aug 18 '05 #3

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

Similar topics

4
by: Gaz | last post by:
Hi, I need to have a table nested within another table. The tables are alongside each other visually speaking, and the nested table (on the right) can vary in size. My problem is that when the...
61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
3
by: Terrence Brannon | last post by:
I don't know what Postgres considers a relation and had no intention of creating one when piping my schema to it... I always DROP TABLE before CREATE TABLE, so here are the ERRORS emitted when...
4
by: maricel | last post by:
I have the following base table structure - DDL: CREATE TABLE "ADMINISTRATOR"."T1" ( "C1" INTEGER NOT NULL ) IN "TEST_TS" ; ALTER TABLE "ADMINISTRATOR"."T1" ADD PRIMARY KEY
4
by: Simone Battagliero | last post by:
I wrote a program which inserts and finds elements in an hash table. Each element of the table is a dinamic list, which holds all elements having the same hash value (calculated by an int...
117
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of...
76
MMcCarthy
by: MMcCarthy | last post by:
Normalisation is the term used to describe how you break a file down into tables to create a database. There are 3 or 4 major steps involved known as 1NF (First Normal Form), 2NF (Second Normal...
7
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the...
5
by: wugon.net | last post by:
question: db2 LUW V8 UNION ALL with table function month() have bad query performance Env: db2 LUW V8 + FP14 Problem : We have history data from 2005/01/01 ~ 2007/05/xx in single big...
5
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.