473,396 Members | 1,748 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,396 software developers and data experts.

Give individual cell's a border?

I would like to have just the top row cells of a table to have borders - is
this possible/easy? or do I have to make the title row another table?

thanks

harry
Jul 20 '05 #1
2 4814
Harry wrote on 23 okt 2003 in comp.lang.javascript:
I would like to have just the top row cells of a table to have borders
- is this possible/easy? or do I have to make the title row another
table?


No js, just css:

<style>
tr.frst td {border:green solid 1px;}
</style>

<table>
<tr class="frst"><td>x</td><td>y</td></tr>
<tr> <td>x</td><td>y</td></tr>
</table>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2
Evertjan. wrote:
Harry wrote on 23 okt 2003 in comp.lang.javascript:
I would like to have just the top row cells of a table to have borders
- is this possible/easy? or do I have to make the title row another
table?
No js, just css:


ACK
<style>
tr.frst td {border:green solid 1px;}
</style>

<table>
<tr class="frst"><td>x</td><td>y</td></tr>
<tr> <td>x</td><td>y</td></tr>
</table>


<head>
...
<style type="text/css">
tr:first-child td {
border:green solid 1px;
}
...
</style>
...
</head>
<body>
...
<table>
<tr>
<td>x</td>
<td>y</td>
</tr>
<tr>
<td>x</td>
<td>y</td>
</tr>
...
</table>
...
</body>

But I assume the top row cells are table heads, so it would
be better to use and format `th' elements instead like

<head>
...
<style type="text/css">
th {
border:green solid 1px;
}
...
</style>
...
</head>
<body>
...
<table>
<thead>
<tr>
<th>x</th>
<th>y</th>
</tr>
</thead>
<tbody>
<tr>
<td>x</td>
<td>y</td>
</tr>
...
</tbody>
</table>
...
</body>
HTH

PointedEars, X-Post & F'up2 comp.infosystems.www.authoring.stylesheets

Jul 20 '05 #3

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

Similar topics

23
by: MattB | last post by:
Hello please help, I have a table cell with a div in it. The div has a width of 300px. but when it is rendered it puts extra space into the table cell. Here's the style <style>...
0
by: yurps | last post by:
Hello here is my html, if you click the missing image in the first column on the left, the div is shown, when clicked again the div disappears...but the bottom border disappears as well...Is there...
7
by: Andrew Poulos | last post by:
I'm using the following code to create a small table with one column and two rows. An image goes into the first cell. //create table var t = document.createElement("TABLE"); t.style.position =...
5
by: Greg N. | last post by:
Hi folks, I have a table cell with a background image, something like <td background=landscape.jpg height=200></td> The sole purpose of this code is to display the image inside that table...
5
by: nivas.meda | last post by:
Hi, I have an excel sheet with a graph and cells.If i change the value in the excel cells the graph will reflect.Now i am going to implement this functionality in html page.I successfully saved...
6
by: tshad | last post by:
I have a cell with 2 items in it: a textbox and a link. The link is actually a button (image), but for the example I am using a link, which is doing the same thing. Here is the stripped down...
6
by: William Sullivan | last post by:
I want to fill a cell in a table with a control. Lets say the control is a listbox--something that you'd think would easily fill a cell, which would be a good thing. So I create the table and...
1
by: Shak | last post by:
Hi all, I have subtotal rows in a datatable that I wish to emphasise by adding borders to. Ive isolated the relevant cells pretty easily, but I cant figure out how to add a border to the cell...
1
by: gbengston | last post by:
Please look at my example, I have a script that pulls the value of one cell and inserts it into an input box in another cell. My problem is that the source cell is itself an input box so when I pull...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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.