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

table header border

dorinbogdan
839 Expert 512MB
I don't succeed to create a table having a border just around the header.
The table records should have no border.
Please advise.
May 21 '07 #1
5 2173
drhowarddrfine
7,435 Expert 4TB
One of two ways:
1) <th style="border: 1px solid red">
2) In css file:
#header{
border:1px solid red
}

<th id="header">

But without the code, I'm not sure if that's what you meant by 'header'.
May 21 '07 #2
dorinbogdan
839 Expert 512MB
The header is the top row, and should have border an all 4 sides (not between cells).
The code is here, but not working as desired:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2.     <style>
  3.         tr.header{
  4.             border: 2px solid black;
  5.             }
  6.         tr.line{
  7.             border: 0px;
  8.             }
  9.     </style>
  10. <body>
  11.     <table cellpading="5" >
  12.         <tr class="header">
  13.             <th>Nom du tire</th>
  14.             <th>Banque du tire</th>
  15.             <th>RIIB du tire</th>
  16.             <th>Echeance le</th>
  17.             <th>Montant</td>
  18.         </tr>
  19.         <tr class="line">
  20.             <td>ARCHE EDITEUR</td>
  21.             <td>SANPAOLO P</td>
  22.             <td>321654987</td>
  23.             <td>10/05/07</td>
  24.             <td>321.45</td>
  25.         </tr>
  26.         <tr class="line">
  27.             <td>ARCHE EDITEUR</td>
  28.             <td>SANPAOLO P</td>
  29.             <td>321654987</td>
  30.             <td>10/05/07</td>
  31.             <td>321.45</td>
  32.         </tr>
  33.     </table>
  34.  
  35.  
  36. </body>
  37. </html>
May 21 '07 #3
drhowarddrfine
7,435 Expert 4TB
I don't think you are going to be able to do it that way. A row is just a grid but not an actual object which can be styled. You may want to rethink how you do that.

Without giving it any thought, each <th> can be set with no spacing between each column/cell and give a border to each side but left and right, thus giving the appearance of one continuous row.
May 21 '07 #4
dorinbogdan
839 Expert 512MB
It works almost fine, now I just try to get rid of the small space between cells:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2.     <style>
  3.         th.h1{
  4.             border-bottom:1px solid black;
  5.             border-left:1px solid black;
  6.             border-top:1px solid black;
  7.             margin:0px;
  8.             }
  9.         th.h2{
  10.             border-bottom:1px solid black;
  11.             border-top:1px solid black;
  12.             border-right-width:0px;
  13.             border-left-width:0px;
  14.             margin:0px;
  15.             }
  16.         th.h3{
  17.             border-bottom:1px solid black;
  18.             border-right:1px solid black;
  19.             border-top:1px solid black;
  20.             border-left-width:0px;
  21.             margin:0px;
  22.             }
  23.         tr.line{
  24.             border: 0px;
  25.             }
  26.     </style>
  27. <body>
  28.     <table CELLPADDING="5" >
  29.         <tr>
  30.             <th class="h1">Nom du tire</th>
  31.             <th class="h2">Banque du tire</th>
  32.             <th class="h2">RIIB du tire</th>
  33.             <th class="h2">Echeance le</th>
  34.             <th class="h3">Montant</td>
  35.         </tr>
  36.         <tr class="line">
  37.             <td>ARCHE EDITEUR</td>
  38.             <td>SANPAOLO P</td>
  39.             <td>321654987</td>
  40.             <td>10/05/07</td>
  41.             <td>321.45</td>
  42.         </tr>
  43.         <tr class="line">
  44.             <td>ARCHE EDITEUR</td>
  45.             <td>SANPAOLO P</td>
  46.             <td>321654987</td>
  47.             <td>10/05/07</td>
  48.             <td>321.45</td>
  49.         </tr>
  50.     </table>
  51.  
  52.  
  53. </body>
  54. </html>
May 21 '07 #5
nomad
664 Expert 512MB
You can do this as well.
Have two seperate tables
One for the header the other for the rows and col

you can use
cellspacing="2" this one make spacing between the col
cellpadding="2 this one make two spaces between the col line ie you get two lines for each col.

[CODE

<body>
<table width="550" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>

<table width="550" border="0" cellspacing="2" cellpadding="2">
<tr>
<th scope="col">&nbsp;</th>
<th scope="col">&nbsp;</th>
<th scope="col">&nbsp;</th>
<th scope="col">&nbsp;</th>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</body>
CODE]

nomad
May 22 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Robert P. Stearns | last post by:
I have been trying to convert the following simple table into CSS. <table> <tr><th colspan=2>Header Area</th></tr> <tr><th>Navigation Area</th><th>Information Area</th></tr> <tr><th...
3
by: JBH | last post by:
I'm having difficulty removing spacing between two rows in a table. Below is a copy of my source code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>About...
1
by: dschectman | last post by:
I have an interesting issue. I need to implement a dynamic table to mimic a select list. Each time you double click from the master list, a row is added to the list of selected items. The list...
7
by: Shawn B. | last post by:
Greetings, I am trying to create a table that has a scrolling body. The problem I'm experiencing is that if the columns in the "body" part of the table exceed the width of the "header" then...
0
by: Romulo NF | last post by:
Greetings again everyone Recently i´ve been asked to develop a script to allow filtering in the content of the table, with dinamic options based on the own content. Example: a table with the name of...
6
by: Romulo NF | last post by:
Greetings again to everyone, Im back to show this grid componenet i´ve developed. With this grid you can show the data like a normal table, remove the rows that you need, add rows, import data,...
15
by: daniel2335 | last post by:
Hello people, I could do with a little help.. I have been piecing some code together to make a table with a fixed header and that has light up rows. I thought id got it but I notice when i scroll...
5
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with...
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.