Link to home
Start Free TrialLog in
Avatar of thiruna
thiruna

asked on

CSS style for Table First Column

Is it possible to apply a CSS style for first column in all tables in General?

      table      {font-size: 100%; margin-top: 1em; margin-bottom: 0em; width: 100%;}
      th      {text-align: left; border-bottom: 1px solid Black; margin: .25em; vertical-align: bottom;}
      tr      {vertical-align: top;}
      td      {margin: .25em; vertical-align: top; border-bottom: 1px solid #CCCCCC;}

Thanks

ASKER CERTIFIED SOLUTION
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of thiruna
thiruna

ASKER

Thanks for comment....

I have around 10 to 15 tables in a single file and I donnt want to go to every table and write the Col tag.  I just to write it the CSS style file and browser should apply this style for first column in all table in html file...is that possible or can it obtained using Javascript...

Thanks
Using javascript you probably can. You have to lookup each <tr> tag, then lookup each first td or th element.

It will probably work, but would be more work than c&p-ing <col class="firstcol" /> fifteen times...

-r-
Avatar of thiruna

ASKER

The reason I require this to be generalised because...HTML file is like a template and CSS as a style sheet in our office....People here dont care about the interface and they just have feed in the table in the following format....

<table>
<tr><th>sadds</th></tr>
<tr><td>dfddsfds</td></tr>
<tr><td>dfddsfds</td></tr>
<tr><td>dfddsfds</td></tr>
<tr><td>dfddsfds</td></tr>
<tr><td>dfddsfds</td></tr>
</table>

and our CSS will do the rest ....

Any help or Suggestions???

Thanks in advance
Thiru
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of thiruna

ASKER

Thanks for your help... but this script highlights only the first cell of every table.  I want to highlight the entire first column of all table....

Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry, misunderstood.  Thanks Roonaan.  :)
-Doug