Jump to content
rootKID

how to give a table same width?...

Recommended Posts

hello again...i have been thinking, when im making a table, lets say 100% to fill out the div i just gave, it DOES go out.. but when i have like 3 td's to fill out, it keeps pushing to the other site.... i would like it like shown below: PICTURE ATTACHED in the picture you can see however much text you now put in, the boxes still have the same width.. is that a normal css class editing with width?, or some sort of speciel method you guys use?... Hoping you understood what i said, had a little bit trouble explaining about it, lol X)...

Share this post


Link to post
Share on other sites

If I understand correctly your table is pushing out beyond the div or design. Since the table is set for 100% you will need to define one row of cells so that it does not go beyond the desire framework. Based on your image you have 5 cells. Set the first row of cells with a set width for each. Use the table header cell ( th ). In your case something like this:

 <table style="width:100%"><tr>  <th style="width: 8%;">P_ID</th>  <th style="width: 23%;">FirstName</th>  <th style="width: 23%;">LastName</th>  <th style="width: 23%;">Address</th>  <th style="width: 23%;">City</th></tr><tr>  <td>data here</td>  <td>data here</td>  <td>data here</td>  <td>data here</td>  <td>data here</td></tr></table>

Edited by newseed

Share this post


Link to post
Share on other sites

hmm, sorry for late reply, thanks. will test later to see if it will work correctly x)...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...