Web Analytics Made Easy -
StatCounter table width question - CodingForum

Announcement

Collapse
No announcement yet.

table width question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • table width question

    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.

  • #2
    Code:
    <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>
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society

    Comment


    • #3
      document.getElementById('myTable').offsetWidth;

      <table id="myTable".......>

      Comment


      • #4
        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.
        -Sk8er9547

        Comment

        Working...
        X