User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 15 Sep 2005, 18:13   #1
queball
Ball
 
queball's Avatar
 
Join Date: Oct 2001
Posts: 4,410
queball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so little
Something I found interesting: formatting columns in HTML

IE will let you format a column any way you like using <col> and <colgroup>, Opera will only let you set border, background, width and visibility, and Mozilla seems not to do background for me.

But sometimes one wishes to display large tables of scientific data without having to style every cell.
So I used Google and found how other people solved it: adjacent sibling selectors.

Code:
<style>
td+td+td {background: red}
td+td+td+td {background: inherit}
</style>

<table border=1>
<tr><td>test</td><td>test</td><td>test</td><td>test</td></tr>
<tr><td>test</td><td>test</td><td>test</td><td>test</td></tr>
<tr><td>test</td><td>test</td><td>test</td><td>test</td></tr>
<tr><td>test</td><td>test</td><td>test</td><td>test</td></tr>
<tr><td>test</td><td>test</td><td>test</td><td>test</td></tr>
</table>
A neat hack.
__________________
#linux
queball is offline   Reply With Quote
Unread 15 Sep 2005, 19:23   #2
meglamaniac
Born Sinful
 
meglamaniac's Avatar
 
Join Date: Nov 2000
Location: Loughborough, UK
Posts: 4,059
meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Re: Something I found interesting: formatting columns in HTML

Cunning CSS usage there.
__________________
Worth dying for. Worth killing for. Worth going to hell for. Amen.
meglamaniac is offline   Reply With Quote
Reply



Forum Jump


All times are GMT +1. The time now is 11:39.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018