whatever
07-11-2002, 03:39 AM
how do you determine the width of a table in pixels? can you do it with javascript?
for example:
<table>
<tr> waaadddddupppp </tr>
<tr> yoooooooooooo </tr>
</table>
The width of the table above is set according to the width of the row text How do you determine the width of the table in pixels?
Thanks Dude.
<table border="0" cellpadding="0" cellspacing="0" width="745" summary="745 pixel wide table">
<tr>
<td width="345">345 pixel wide cell</td>
<td width="400">400 pixel wide cell</td>
</tr>
<tr>
<td colspan="2" width="745" height="120">745px wide, 120px high cell spanning two columns</td>
</tr>
</table>
adios
07-11-2002, 04:54 AM
document.getElementById('myTable').offsetWidth;
<table id="myTable".......>
Sk8er9547
07-11-2002, 03:35 PM
Your table code is missing something....here's an overview of what most of the table tags do:
<table> - defines that you are starting a table
<tr> - defines a new row in your table
<td> - defines a new column in your table
</td> - ends the column
</tr> - ends the row
</table> - ends the table
To define the width of a table in pixels, just use
<table width="100 "> and change the number in red to your specifications.