Solved

Table Problem-Urgent

Posted on 2003-11-14
11
298 Views
Last Modified: 2010-04-09
hi,
  I have a table such as this :

<table border="4"BGColor="#FFF8DC" width="60%" CELLPADDING="4" style="margin-left:190px;" >
   <tr>
     <td align=center>
       Organation Name
     </td>
     <td align=center>
       Project Name
     </td>

   <td align=center>
     Description
   </td>
   <td align=center>
     Start Date
    </td>
   <td align=center>
     End Date
    </td>
    <td align=center>
     Required Skills
     </td>

   </tr>
 </table>


<table border="1"BGColor="#FFFFF0" width="60%" CELLPADDING="4" style="margin-left:190px;" >

<tr>

<td align=center><%= rs.getString( "organname") %></td>
     <td align=center> <%= rs.getString("projectid" ) %></td>
     <td align=center><%= rs.getString( "description") %></td>
     <td align=center> <%= rs.getString("start" ) %></td>
     <td align=center><%= rs.getString( "end") %></td>
     <td align=center> <%= rs.getString("skillid" ) %></td>

   </tr>
</table>


My problem is when this two tables came out, the first table (headings) do not fit the second table width.If the second table has a lot rows , the length of each column is not same with each other as well as the headings.

How d o i modify this.
Thanks
0
Comment
Question by:Jasbir21
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 19

Expert Comment

by:Dexstar
ID: 9751962
Jasbir21:

> My problem is when this two tables came out, the first table (headings) do
> not fit the second table width.If the second table has a lot rows , the length
> of each column is not same with each other as well as the headings.

DO NOT use 2 tables.  Use one.  Basically, just take out the first </table> and the second <table...> tags, and see how it looks.

Hope That Helps,
Dex*
0
 

Author Comment

by:Jasbir21
ID: 9752099
hi,

  When i try to use one table, the border and color for the headings becames similar for the data in the rows.

Actually, i need to have the headings in a different border and the data(rows ) in a different border.

I mean the color for the headings table in a bit dark with the style a bit lifted up but the color for the data in table row is a bit light with not lifted up.


thanks
0
 

Assisted Solution

by:slatif
slatif earned 40 total points
ID: 9752176
Try this:

<table border="4" BGColor="#FFF8DC" width="60%" CELLPADDING="4" style="margin-left:190px;" >
   <tr>
     <td align=center width="10%">
       Organation Name
     </td>
     <td align=center width="10%">
       Project Name
     </td>

   <td align=center width="10%">
     Description
   </td>
   <td align=center width="10%">
     Start Date
    </td>
   <td align=center width="10%">
     End Date
    </td>
    <td align=center width="10%">
     Required Skills
     </td>

   </tr>
 </table>


<table border="1" BGColor="#FFFFF0" width="60%" CELLPADDING="4" style="margin-left:190px;" >

<tr>


       <td align=center width="10%"><%= rs.getString( "organname") %></td>
     <td align=center width="10%"> <%= rs.getString("projectid" ) %></td>
     <td align=center width="10%"><%= rs.getString( "description") %></td>
     <td align=center width="10%"> <%= rs.getString("start" ) %></td>
     <td align=center width="10%"><%= rs.getString( "end") %></td>
     <td align=center width="10%"> <%= rs.getString("skillid" ) %></td>

</tr>
</table>

Hope this will work.
0
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
LVL 31

Accepted Solution

by:
seanpowell earned 60 total points
ID: 9752217
You can play around with the colors and sizes, but CSS is the best way to deal with this, all in one table:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title></title>
<style type="text/css">
<!--
table.header { margin-left:190px; width:60%; }
td.heading    { border: medium ridge #cccccc; background-color:#FFF8DC; padding:2px; }
td.data         { border:thin solid #cccccc; background-color:#FFFFF0; padding:2px; }
//-->
</style>
</head>
<body>
<table class="header" border="1">
  <tr>
    <td align=center class="heading">Organation Name</td>
    <td align=center class="heading">Project Name</td>
    <td align=center class="heading">Description</td>
    <td align=center class="heading">Start Date</td>
    <td align=center class="heading">End Date</td>
    <td align=center class="heading">Required Skills</td>
  </tr>
  <tr class="data">
    <td align=center class="data">%= rs.getString( "organname") %></td>
    <td align=center class="data"><%= rs.getString("projectid" ) %></td>
    <td align=center class="data"><%= rs.getString( "description") %></td>
    <td align=center class="data"><%= rs.getString("start" ) %></td>
    <td align=center class="data"><%= rs.getString( "end") %></td>
    <td align=center class="data"><%= rs.getString("skillid" ) %></td>
   </tr>
</table>
</body>
</html>
0
 

Author Comment

by:Jasbir21
ID: 9752219
thank you,it works fine

God bless
0
 
LVL 19

Expert Comment

by:Dexstar
ID: 9752226
slatif:  That still won't work if any of the fields exceed 10%

jasbir:  Use style tags to control the border on the header row.  That will be 10x easier than trying to get 2 tables to line correctly 100% of the time with variable data.

Enjoy,
Dex*
0
 

Author Comment

by:Jasbir21
ID: 9752233
thank you all for the input, i splitted the points because both of your answers help me.

Thanks again
0
 
LVL 19

Expert Comment

by:Dexstar
ID: 9752243
What's up with that?  You used my idea of 1 table, but I didn't get any points?  How did slatif's suggestion help you?  It doesn't even work...

D*
0
 

Author Comment

by:Jasbir21
ID: 9752261
hi,
   georgemarin,
 
when i tried  the headings column size does not match the data column

do, i need to add something

Thanks
0
 

Author Comment

by:Jasbir21
ID: 9752296
..hi,
  i get it you use one table, and i combined it with 2 table, that's why the column doesn't match.


Sorry,

Dexstar,
  I am very sorry, i spliteed points into three but i guess i did an error something.

I am posting for the points at a new link ,pls accept it with humble appologies.
Thanks
0
 

Author Comment

by:Jasbir21
ID: 9752307
Dexstar,
  pls go to this link:

http://www.experts-exchange.com/Web/Web_Languages/HTML/Q_20798719.html

Pls accept it
Thank you
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question