Jump to content

an alt way for it using css


virtualadz

Recommended Posts

an alternative way for it using css: the tr's and td's will appear more than 100 times!, that's why

<html><head><title>W3schools</title><style type="text/css">td.TGLOSS {font-family: arial, verdana;font-size: 11px;color: #333333;</style></head><body><table borderColor=#ffffff cellSpacing=0 borderColorDark=#ffffff cellPadding=0 width=474 borderColorLight=#ffffff border=1> <tr>  <td class="TGLOSS" borderColor=#008000 borderColorLight=#c0c0c0 align=left width=103 borderColorDark=#ffffff height=30> Agony of the leaves</td>  <td class="TGLOSS" borderColor=#008000 borderColorLight=#c0c0c0 width=355 borderColorDark=#ffffff>This is a description of the relaxation of curled leaves during steeping.</td> </tr></table>       </body></html>

Link to comment
Share on other sites

well i can't use simply td and tr , i have 1000's in other pages, i will have to embed my default stylesheet in this page. but that's not the question:i already made the text relevant details using css, how do i make these through cssborderColor=#008000 borderColorLight=#c0c0c0 align=left width=103 borderColorDark=#ffffff height=30, i want these attributes to be defined in the css

Link to comment
Share on other sites

i needed to move all the info from td and tr using css, the tr and td will appear more than 100 times so it's better to use css. so how do i define those td & tr attributes using css.

You know it's still ok to use tables, they have not been depricated...You say you needed to move all the info, why is that? is there as specific reason or is it just because you don't wan't to use tables?W3 recomends using css for page layouts, it sounds as if you have tabular data, tables should still be used for tabular data. I would use tables for your 100 items and style the tables with css.
Link to comment
Share on other sites

is there a way doing it with div's and with complete css.

You could try:<div><span>Agony of the leaves</span><span> This is a description of the relaxation of curled leaves during steeping.</span></div>with css in the header.div{width:784px}span{width:50%}
Link to comment
Share on other sites

You can just use CSS that nests in other tags so you can only affect the tables you want... like: div class="div1" > table > td Where "div class='div1' " would be the first css element in your css where it can set rules to things INSIDE the div to narrow down which tag you want to affect... like so: .div1 table td {Your Elements here}But here's what I can do with your code:css:

.table_class {  border-collapse: collapse;  margin: 0;  padding: 0;  width: 474px;}.table_class td {  border: 1px solid white;  width: 335px;  height: 10px;  text-align: left;  font-family: arial, verdana;  font-size: 11px;  color: #333333;}.table_class tr {  [tr classes here]}

html:

<table class="table_class">  <tr>    <td borderColor="#008000" borderColorLight="#c0c0c0" borderColorDark="#ffffff">Agony of the leaves</td>    <td borderColor="#008000" borderColorLight="#c0c0c0" borderColorDark="#ffffff">This is a description of the relaxation of curled leaves during steeping.</td>  </tr></table>

That's just my 43 cents :)

Link to comment
Share on other sites

Yes!Let me demonstrate it.

<html><head><style type="text/css">table.examp_table, td{border-color: #00f;}</style></head><body><table border="2" class="examp_table"><tr><td>Cell 1</td><td>Cell 2</td></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table></body></html>

Check this page for a reference to CSS borders :)

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...