I want to learn with jQuery "td width", for an example:
if(td.width=="100"){
alert("td width = 100");
}
Please explain.
<table width="200" border="1">
<tr>
<td width="100">Number</td>
<td width="50">Order</td>
</tr>
<tr>
<td width="100">1</td>
<td width="50">Car</td>
</tr>
</table>
here's a simple extension, the css could be edited to do something less intrusive.
var tdWidthLimit = 100;
$('td').each(function() {
tdWidth = $(this).width();
if (tdWidth >= tdWidthLimit)
{
alert('hightlighted td width is ' + tdWidth);
$(this).css({'background-color' : '#f00'});
}
});
working demo here
$('td').each(function(){
if($(this).width() == 100){
alert(this.textContent + " width = 100");
}
});
This will look through all your tds and then alert the td's text content and "width = 100" if the width is 100
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With