It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

Table tag question.

Table tag question.

Postby RosieGp on Thu Feb 04, 2010 2:49 pm

It is very basic but some how I don't get it.
in my table tag I have
<table width="100%" border="1" cellspacing="0" cellpadding="0">
but I don't like the border showing up like the way it is. I want it to be flat regular black line, and then I want to partition this table in the middle so that the Table of Contents returned by my sql query shows up in equally on both sides... in a table

1. INTRODUCTION 3. BASIC ALGEBRA
2. SIMPLE ALGEBRA 4. ADVANCED ALGEBRA
Right now I have the following code:

Code: Select all
<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <cfoutput query="qry">
      <tr>
        <td >#numbering#. #Table_Of_Contents#</td>
      </tr>
      <cfset numbering = numbering + 1 />
      </cfoutput>
    </table>

ANy help is appreciated..
RosieGp
 
Posts: 7
Joined: Thu Feb 04, 2010 2:46 pm

Re: Table tag question.

Postby harrierdh on Thu Feb 04, 2010 3:22 pm

You can format borders using CSS. It works a little different though. For instance:

<table style="border: 1px solid black">

However it will not put a border on your cells. So you really need to do something like this. (Untested code, should give you some ideas though)

<head>
<style>
#mytable {
border-top: 1px solid black;
border-left: 1px solid black;
}
.mytd {
border-bottom: 1px solid black;
border-right: 1px solid black;
}
</script>
</head>
<table id="mytable">
<tr>
<td class="mytd">
harrierdh
50+ Club
 
Posts: 51
Joined: Wed Dec 16, 2009 7:04 pm

Re: Table tag question.

Postby RosieGp on Tue Feb 09, 2010 2:26 pm

i tried to do this and define this function then call it in table it doesn't show the borders
Do you see anything wrong: Please advice
Code: Select all
<style>
   th,table,td,p{
      font-family:Arial, Helvetica, sans-serif;
      font-size:12px;
   }
   mytable {
   border-top: 1px solid black;
   border-left: 1px solid black;
   }
   
   table.tableHeader,h2,h1{
      font-family:Arial, Helvetica, sans-serif;
      font-size:14px;
      font-weight:bold;
   }
   mytable.mytd {
      border-bottom: 1px solid black;
      border-right: 1px solid black;
   }
   
</style>

<cfif #qryTableOne.recordcount# gt 2>
    <table id="mytable" width="100%">
   <cfoutput query="qryTableOne">
      <tr>
        <td class="mytd" align="left" style="font-family:Arial, Helvetica, sans-serif;
      font-size:12px;">#numbering#. #This_data#</td>
      </tr>
      <cfset numbering = numbering + 1 />
      </cfoutput>
    </table>
   </cfif>
RosieGp
 
Posts: 7
Joined: Thu Feb 04, 2010 2:46 pm

Re: Table tag question.

Postby harrierdh on Tue Feb 09, 2010 3:25 pm

The only thing I see at first glance is this.

mytable {
border-top: 1px solid black;
border-left: 1px solid black;
}

Should be

#mytable {
border-top: 1px solid black;
border-left: 1px solid black;
}

You reference an id in CSS by prefixing with a pound sign. You reference a class by prefixing with a period. You can use a class on multiple elements. You can't do this with an id. Every id has to be unique.

If I'm telling you stuff you already know, I'm not trying to offend you. I just don't know where you are with this stuff.
harrierdh
50+ Club
 
Posts: 51
Joined: Wed Dec 16, 2009 7:04 pm

Re: Table tag question.

Postby RosieGp on Tue Feb 09, 2010 3:38 pm

No problem. I just started working with this like for 2 weeks so just very basic knowledge... I added # sign n front still not showing up any thing
Code: Select all
<style>
   th,table,td,p{
      font-family:Arial, Helvetica, sans-serif;
      font-size:12px;
   }
   #mytable {
   border-top: 1px solid black;
   border-left: 1px solid black;
   }
   
   table.tableHeader,h2,h1{
      font-family:Arial, Helvetica, sans-serif;
      font-size:14px;
      font-weight:bold;
   }
   mytable.mytd {
      border-bottom: 1px solid black;
      border-right: 1px solid black;
   }
   
</style>

<cfif #qryTableOne.recordcount# gt 2>
    <table id="mytable" width="100%">
   <cfoutput query="qryTableOne">
      <tr>
        <td class="mytd" align="left" style="font-family:Arial, Helvetica, sans-serif;
      font-size:12px;">#numbering#. #This_data#</td>
      </tr>
      <cfset numbering = numbering + 1 />
      </cfoutput>
    </table>
   </cfif>


ANy other way to do this...
RosieGp
 
Posts: 7
Joined: Thu Feb 04, 2010 2:46 pm

Re: Table tag question.

Postby harrierdh on Tue Feb 09, 2010 4:54 pm

RosieGp,
I can't really try your code because you are not posting html. It looks like JSF or ColdFusion. Bring your page up in a browser and click on View>Page Source. Post that and then we can help you.
harrierdh
50+ Club
 
Posts: 51
Joined: Wed Dec 16, 2009 7:04 pm

Re: Table tag question.

Postby RosieGp on Tue Feb 09, 2010 6:43 pm

yes my code is in coldfusion. The output is in PDF there is no view source....
even if i use to output it in format="flashpaper", it doesnot show the code, just a head and body tag...
RosieGp
 
Posts: 7
Joined: Thu Feb 04, 2010 2:46 pm

Re: Table tag question.

Postby RosieGp on Tue Feb 09, 2010 7:05 pm

I kind of got what i want...
in the table tag I added style="border" and with td style="border-bottom". It worked...
Thanks...
RosieGp
 
Posts: 7
Joined: Thu Feb 04, 2010 2:46 pm


Who is online

Users browsing this forum: No registered users and 7 guests